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.02 - 0.01 and 0.02 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1466843.20..1466843.21 rows=1 width=8) (actual time=21383.374..21383.375 rows=1 loops=1) Buffers: shared hit=760394 read=268641 written=8489 -> Bitmap Heap Scan on lineitem (cost=191334.29..1463024.56 rows=763727 width=8) (actual time=8669.241..21181.677 rows=763022 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-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: 8347045 Heap Blocks: exact=1004141 Buffers: shared hit=760394 read=268641 written=8489 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191143.36 rows=9120679 width=0) (actual time=7908.184..7908.184 rows=9118876 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=88 read=24806 written=45 Planning time: 1.834 ms Execution time: 21388.753 ms (13 rows) COMMIT; COMMIT