A15: regressed anti-join, index-only master (min): 9.041 ms (avg=9.134, max=9.262) patch + yield (prefetch=on) (min): 8.429 ms (avg=8.520, max=8.636) [0.932x vs master] patch + no yield (prefetch=on) (min): 10.225 ms (avg=10.323, max=10.394) [1.131x vs master] Query: SELECT o.customer_id, o.order_date FROM prefetch_orders o WHERE o.order_date BETWEEN '2023-02-09' AND '2023-02-23' AND o.customer_id BETWEEN 36307 AND 37126 AND NOT EXISTS ( SELECT 1 FROM prefetch_customers c WHERE c.customer_id = o.customer_id AND c.region_id = 4 ) ORDER BY o.order_date master EXPLAIN ANALYZE: Sort (actual rows=7882.00 loops=1) Sort Key: o.order_date Sort Method: quicksort Memory: 377kB Buffers: shared hit=11732 read=237 I/O Timings: shared read=1.145 -> Merge Anti Join (actual rows=7882.00 loops=1) Merge Cond: (o.customer_id = c.customer_id) Buffers: shared hit=11732 read=237 I/O Timings: shared read=1.145 -> Index Only Scan using prefetch_orders_cust_date_idx on prefetch_orders o (actual rows=8445.00 loops=1) Index Cond: ((customer_id >= 36307) AND (customer_id <= 37126) AND (order_date >= '2023-02-09'::date) AND (order_date <= '2023-02-23'::date)) Heap Fetches: 0 Index Searches: 772 Buffers: shared hit=11629 -> Index Scan using prefetch_customers_pkey on prefetch_customers c (actual rows=1858.00 loops=1) Filter: (region_id = 4) Rows Removed by Filter: 35285 Index Searches: 1 Buffers: shared hit=103 read=237 I/O Timings: shared read=1.145 Planning: Buffers: shared hit=16 Planning Time: 0.155 ms Serialization: output=193kB format=text Execution Time: 9.041 ms patch + yield (prefetch=on) EXPLAIN ANALYZE: Sort (actual rows=7882.00 loops=1) Sort Key: o.order_date Sort Method: quicksort Memory: 377kB Buffers: shared hit=11732 read=237 I/O Timings: shared read=0.825 -> Merge Anti Join (actual rows=7882.00 loops=1) Merge Cond: (o.customer_id = c.customer_id) Buffers: shared hit=11732 read=237 I/O Timings: shared read=0.825 -> Index Only Scan using prefetch_orders_cust_date_idx on prefetch_orders o (actual rows=8445.00 loops=1) Index Cond: ((customer_id >= 36307) AND (customer_id <= 37126) AND (order_date >= '2023-02-09'::date) AND (order_date <= '2023-02-23'::date)) Heap Fetches: 0 Index Searches: 772 Buffers: shared hit=11629 -> Index Scan using prefetch_customers_pkey on prefetch_customers c (actual rows=1858.00 loops=1) Filter: (region_id = 4) Rows Removed by Filter: 35285 Index Searches: 1 Buffers: shared hit=103 read=237 I/O Timings: shared read=0.825 Planning: Buffers: shared hit=16 Planning Time: 0.166 ms Serialization: output=193kB format=text Execution Time: 8.429 ms patch + no yield (prefetch=on) EXPLAIN ANALYZE: Sort (actual rows=7882.00 loops=1) Sort Key: o.order_date Sort Method: quicksort Memory: 377kB Buffers: shared hit=11795 read=385 I/O Timings: shared read=1.517 -> Merge Anti Join (actual rows=7882.00 loops=1) Merge Cond: (o.customer_id = c.customer_id) Buffers: shared hit=11795 read=385 I/O Timings: shared read=1.517 -> Index Only Scan using prefetch_orders_cust_date_idx on prefetch_orders o (actual rows=8445.00 loops=1) Index Cond: ((customer_id >= 36307) AND (customer_id <= 37126) AND (order_date >= '2023-02-09'::date) AND (order_date <= '2023-02-23'::date)) Heap Fetches: 0 Index Searches: 772 Buffers: shared hit=11629 -> Index Scan using prefetch_customers_pkey on prefetch_customers c (actual rows=1858.00 loops=1) Filter: (region_id = 4) Rows Removed by Filter: 35285 Index Searches: 1 Buffers: shared hit=166 read=385 I/O Timings: shared read=1.517 Planning: Buffers: shared hit=16 Planning Time: 0.149 ms Serialization: output=193kB format=text Execution Time: 10.225 ms