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.02 - 0.01 and 0.02 + 0.01 and l_quantity < 24; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=1468649.46..1468649.47 rows=1 width=8) (actual time=95821.654..95821.655 rows=1 loops=1) Buffers: shared hit=265434 read=765487 written=2035 -> Bitmap Heap Scan on lineitem (cost=191077.18..1464829.74 rows=763945 width=8) (actual time=12478.301..95365.996 rows=761612 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.01::double precision) AND (l_discount <= 0.03::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8346338 Buffers: shared hit=265434 read=765487 written=2035 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190886.19 rows=9117536 width=0) (actual time=11196.057..11196.057 rows=9126632 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared read=24866 Total runtime: 95834.691 ms (11 rows) COMMIT; COMMIT