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.03 - 0.01 and 0.03 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1472801.55..1472801.56 rows=1 width=8) (actual time=21484.355..21484.356 rows=1 loops=1) Buffers: shared hit=763943 read=267971 dirtied=2 written=13 -> Bitmap Heap Scan on lineitem (cost=192428.94..1468798.44 rows=800622 width=8) (actual time=7858.264..21281.592 rows=793886 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-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: 8314066 Heap Blocks: exact=1007049 Buffers: shared hit=763943 read=267971 dirtied=2 written=13 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192228.79 rows=9186822 width=0) (actual time=7299.235..7299.235 rows=9135631 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared read=24865 written=11 Planning time: 1.948 ms Execution time: 21496.293 ms (13 rows) COMMIT; COMMIT