BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1993-01-01' and l_shipdate < cast(date '1993-01-01' + interval '1 year' as date) and l_discount between 0.06 - 0.01 and 0.06 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1467982.11..1467982.12 rows=1 width=8) (actual time=15971.251..15971.251 rows=1 loops=1) Buffers: shared hit=263689 read=765347 written=3626 -> Bitmap Heap Scan on lineitem (cost=191881.78..1464149.23 rows=766576 width=8) (actual time=3528.733..15817.609 rows=763069 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.05::double precision) AND (l_discount <= 0.07::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8355705 Buffers: shared hit=263689 read=765347 written=3626 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191690.14 rows=9146331 width=0) (actual time=3098.642..3098.642 rows=9118774 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=18 read=24877 written=532 Total runtime: 15986.760 ms (11 rows) COMMIT; COMMIT