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.04 - 0.01 and 0.04 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1478560.35..1478560.36 rows=1 width=8) (actual time=26121.938..26121.939 rows=1 loops=1) Buffers: shared hit=576783 read=465321 written=422 -> Bitmap Heap Scan on lineitem (cost=190531.67..1476677.77 rows=376516 width=8) (actual time=8747.024..25950.369 rows=381923 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Filter: ((l_discount >= 0.03::double precision) AND (l_discount <= 0.05::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8731687 Buffers: shared hit=576783 read=465321 written=422 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190437.54 rows=9147871 width=0) (actual time=8079.612..8079.612 rows=9233674 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared read=24887 Total runtime: 26130.419 ms (11 rows) COMMIT; COMMIT