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.03 - 0.01 and 0.03 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1471849.10..1471849.11 rows=1 width=8) (actual time=16829.381..16829.381 rows=1 loops=1) Buffers: shared hit=859026 read=174063 dirtied=48 written=1295 -> Bitmap Heap Scan on lineitem (cost=191413.59..1467871.40 rows=795539 width=8) (actual time=4768.927..16649.861 rows=795862 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Filter: ((l_discount >= 0.02::double precision) AND (l_discount <= 0.04::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8319381 Heap Blocks: exact=1008203 Buffers: shared hit=859026 read=174063 dirtied=48 written=1295 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191214.71 rows=9143014 width=0) (actual time=4279.272..4279.272 rows=9151916 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared read=24886 written=3 Planning time: 1.846 ms Execution time: 16841.857 ms (13 rows) COMMIT; COMMIT