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.08 - 0.01 and 0.08 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1477698.60..1477698.61 rows=1 width=8) (actual time=42926.402..42926.402 rows=1 loops=1) Buffers: shared hit=79449 read=955803 dirtied=693 written=12096 -> Bitmap Heap Scan on lineitem (cost=193092.29..1473678.28 rows=804065 width=8) (actual time=8970.734..42552.764 rows=795840 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Filter: ((l_discount >= 0.07::double precision) AND (l_discount <= 0.09::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8336614 Buffers: shared hit=79449 read=955803 dirtied=693 written=12096 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192891.27 rows=9232444 width=0) (actual time=7864.816..7864.816 rows=9186518 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared hit=3949 read=20984 written=1902 Total runtime: 42933.584 ms (11 rows) COMMIT; COMMIT