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 < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1481172.84..1481172.85 rows=1 width=8) (actual time=17685.272..17685.273 rows=1 loops=1) Buffers: shared hit=724777 read=312465 written=3102 -> Bitmap Heap Scan on lineitem (cost=193699.44..1477287.86 rows=776996 width=8) (actual time=5425.772..17480.380 rows=763723 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 < 24::double precision)) Rows Removed by Filter: 8359249 Heap Blocks: exact=1012310 Buffers: shared hit=724777 read=312465 written=3102 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..193505.20 rows=9271663 width=0) (actual time=4879.429..4879.429 rows=9208729 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared hit=1588 read=23344 written=1063 Planning time: 2.932 ms Execution time: 17690.159 ms (13 rows) COMMIT; COMMIT