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=1465088.27..1465088.28 rows=1 width=8) (actual time=29454.830..29454.831 rows=1 loops=1) Buffers: shared hit=151058 read=881022 -> Bitmap Heap Scan on lineitem (cost=189634.96..1463098.40 rows=397974 width=8) (actual time=7957.813..29246.524 rows=396955 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: 8718429 Buffers: shared hit=151058 read=881022 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..189535.47 rows=9057664 width=0) (actual time=7287.096..7287.096 rows=9142993 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=2 read=24885 Total runtime: 29462.049 ms (11 rows) COMMIT; COMMIT