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.03 - 0.01 and 0.03 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1486733.29..1486733.30 rows=1 width=8) (actual time=31807.430..31807.431 rows=1 loops=1) Buffers: shared hit=369045 read=673770 dirtied=708 written=9325 -> Bitmap Heap Scan on lineitem (cost=193138.78..1482821.62 rows=782334 width=8) (actual time=9632.583..31492.903 rows=762528 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.02::double precision) AND (l_discount <= 0.04::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8349029 Buffers: shared hit=369045 read=673770 dirtied=708 written=9325 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192943.20 rows=9271637 width=0) (actual time=8979.860..8979.860 rows=9245815 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=5774 read=19121 written=3277 Total runtime: 31822.672 ms (11 rows) COMMIT; COMMIT