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.07 - 0.01 and 0.07 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1479473.87..1479473.88 rows=1 width=8) (actual time=18867.917..18867.917 rows=1 loops=1) Buffers: shared hit=489563 read=550530 written=637 -> Bitmap Heap Scan on lineitem (cost=191212.77..1475656.81 rows=763412 width=8) (actual time=6133.285..18700.444 rows=764258 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.06::double precision) AND (l_discount <= 0.08::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8356438 Heap Blocks: exact=1015199 Buffers: shared hit=489563 read=550530 written=637 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191021.92 rows=9166935 width=0) (actual time=5525.642..5525.642 rows=9219239 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared read=24894 written=34 Planning time: 1.761 ms Execution time: 18874.126 ms (13 rows) COMMIT; COMMIT