BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < cast(date '1994-01-01' + interval '1 year' as date) and l_discount between 0.02 - 0.01 and 0.02 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1479738.19..1479738.20 rows=1 width=8) (actual time=18242.672..18242.672 rows=1 loops=1) Buffers: shared hit=503003 read=537930 dirtied=545 written=17167 -> Bitmap Heap Scan on lineitem (cost=190771.83..1475918.46 rows=763945 width=8) (actual time=5266.789..18045.229 rows=761507 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.01::double precision) AND (l_discount <= 0.03::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8346248 Heap Blocks: exact=1016068 Buffers: shared hit=503003 read=537930 dirtied=545 written=17167 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190580.85 rows=9150428 width=0) (actual time=4703.522..4703.522 rows=9217485 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=2 read=24863 written=16 Planning time: 1.754 ms Execution time: 18251.342 ms (13 rows) COMMIT; COMMIT