BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1996-01-01' and l_shipdate < cast(date '1996-01-01' + interval '1 year' as date) and l_discount between 0.09 - 0.01 and 0.09 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1467366.14..1467366.15 rows=1 width=8) (actual time=15333.911..15333.912 rows=1 loops=1) Buffers: shared hit=609305 read=419951 dirtied=501 -> Bitmap Heap Scan on lineitem (cost=192406.08..1465341.76 rows=404877 width=8) (actual time=5091.869..15243.432 rows=399294 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Filter: ((l_discount >= 0.08::double precision) AND (l_discount <= 0.1::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8733169 Heap Blocks: exact=1004324 Buffers: shared hit=609305 read=419951 dirtied=501 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192304.86 rows=9176030 width=0) (actual time=4548.089..4548.089 rows=9132463 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared read=24932 Planning time: 1.686 ms Execution time: 15337.003 ms (13 rows) COMMIT; COMMIT