BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < cast(date '1994-01-01' + interval '1 year' as date) and l_discount between 0.09 - 0.01 and 0.09 + 0.01 and l_quantity < 24; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=1363666.39..1363666.40 rows=1 width=8) (actual time=29186.384..29186.384 rows=1 loops=1) Buffers: shared hit=675620 read=390901 -> Bitmap Heap Scan on lineitem (cost=91028.17..1361767.99 rows=379680 width=8) (actual time=123.769..29031.126 rows=380617 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Rows Removed by Index Recheck: 50937522 Filter: ((l_discount >= 0.08::double precision) AND (l_discount <= 0.1::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8727530 Heap Blocks: lossy=1066473 Buffers: shared hit=675620 read=390901 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey_brin_idx (cost=0.00..90933.25 rows=9078525 width=0) (actual time=122.957..122.957 rows=10664960 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=12 read=36 Planning time: 3.261 ms Execution time: 29186.610 ms (14 rows) COMMIT; COMMIT