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=1484681.40..1484681.41 rows=1 width=8) (actual time=23099.557..23099.557 rows=1 loops=1) Buffers: shared hit=318970 read=722128 dirtied=963 written=782 -> Bitmap Heap Scan on lineitem (cost=193059.24..1480660.84 rows=804112 width=8) (actual time=7734.682..22854.662 rows=794891 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: 8309495 Buffers: shared hit=318970 read=722128 dirtied=963 written=782 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192858.21 rows=9259538 width=0) (actual time=6997.727..6997.727 rows=9224450 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared read=24887 written=1 Total runtime: 23107.909 ms (11 rows) COMMIT; COMMIT