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.05 - 0.01 and 0.05 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1467245.99..1467246.00 rows=1 width=8) (actual time=18113.643..18113.644 rows=1 loops=1) Buffers: shared hit=630718 read=400354 written=29 -> Bitmap Heap Scan on lineitem (cost=190398.22..1463429.61 rows=763275 width=8) (actual time=6225.225..17955.014 rows=763101 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.04::double precision) AND (l_discount <= 0.06::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8356644 Heap Blocks: exact=1006178 Buffers: shared hit=630718 read=400354 written=29 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190207.40 rows=9085484 width=0) (actual time=5597.114..5597.114 rows=9137198 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared read=24894 written=13 Planning time: 2.554 ms Execution time: 18122.894 ms (13 rows) COMMIT; COMMIT