BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1996-01-01' and l_shipdate < cast(date '1996-01-01' + interval '1 year' as date) and l_discount between 0.03 - 0.01 and 0.03 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1472480.89..1472480.90 rows=1 width=8) (actual time=19134.853..19134.853 rows=1 loops=1) Buffers: shared hit=430383 read=601879 dirtied=26 written=49 -> Bitmap Heap Scan on lineitem (cost=192280.26..1468487.28 rows=798722 width=8) (actual time=4867.778..18957.483 rows=797477 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Filter: ((l_discount >= 0.02::double precision) AND (l_discount <= 0.04::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8334768 Heap Blocks: exact=1007330 Buffers: shared hit=430383 read=601879 dirtied=26 written=49 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192080.58 rows=9179601 width=0) (actual time=4293.013..4293.013 rows=9159315 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared read=24932 Planning time: 1.913 ms Execution time: 19141.006 ms (13 rows) COMMIT; COMMIT