BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1997-01-01' and l_shipdate < cast(date '1997-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=1484565.66..1484565.67 rows=1 width=8) (actual time=16370.308..16370.308 rows=1 loops=1) Buffers: shared hit=473722 read=566067 written=1169 -> Bitmap Heap Scan on lineitem (cost=193559.63..1480522.70 rows=808591 width=8) (actual time=4477.234..16197.601 rows=796537 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-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: 8316468 Heap Blocks: exact=1014916 Buffers: shared hit=473722 read=566067 written=1169 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..193357.48 rows=9278892 width=0) (actual time=3994.292..3994.292 rows=9212081 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared read=24873 written=34 Planning time: 2.139 ms Execution time: 16376.547 ms (13 rows) COMMIT; COMMIT