BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1995-01-01' and l_shipdate < cast(date '1995-01-01' + interval '1 year' as date) and l_discount between 0.09 - 0.01 and 0.09 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1483523.90..1483523.91 rows=1 width=8) (actual time=19892.125..19892.126 rows=1 loops=1) Buffers: shared hit=468665 read=573438 written=86 -> Bitmap Heap Scan on lineitem (cost=192856.39..1481515.00 rows=401781 width=8) (actual time=5697.690..19765.281 rows=396896 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Filter: ((l_discount >= 0.08::double precision) AND (l_discount <= 0.1::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8716714 Heap Blocks: exact=1017217 Buffers: shared hit=468665 read=573438 written=86 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192755.95 rows=9259538 width=0) (actual time=5156.097..5156.097 rows=9233674 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=3 read=24883 written=73 Planning time: 1.779 ms Execution time: 19899.496 ms (13 rows) COMMIT; COMMIT