diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/memoize.out /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/memoize.out --- /tmp/cirrus-ci-build/src/test/regress/expected/memoize.out 2025-04-14 08:11:58.162981700 +0000 +++ /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/memoize.out 2025-04-14 08:21:16.990853620 +0000 @@ -46,12 +46,13 @@ -> Memoize (actual rows=1.00 loops=N) Cache Key: t2.twenty Cache Mode: logical + Estimated Capacity: 20 Estimated Distinct Lookup Keys: 20 Hits: 980 Misses: 20 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using tenk1_unique1 on tenk1 t1 (actual rows=1.00 loops=N) Index Cond: (unique1 = t2.twenty) Heap Fetches: N Index Searches: N -(13 rows) +(14 rows) -- And check we get the expected results. SELECT COUNT(*),AVG(t1.unique1) FROM tenk1 t1 @@ -78,12 +79,13 @@ -> Memoize (actual rows=1.00 loops=N) Cache Key: t1.twenty Cache Mode: binary + Estimated Capacity: 20 Estimated Distinct Lookup Keys: 20 Hits: 980 Misses: 20 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using tenk1_unique1 on tenk1 t2 (actual rows=1.00 loops=N) Index Cond: (unique1 = t1.twenty) Heap Fetches: N Index Searches: N -(13 rows) +(14 rows) -- And check we get the expected results. SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1, @@ -113,6 +115,7 @@ -> Memoize (actual rows=2.00 loops=N) Cache Key: t1.two Cache Mode: binary + Estimated Capacity: 2 Estimated Distinct Lookup Keys: 2 Hits: 8 Misses: 2 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Subquery Scan on t2 (actual rows=2.00 loops=N) Filter: (t1.two = t2.two) @@ -120,7 +123,7 @@ -> Index Scan using tenk1_unique1 on tenk1 t2_1 (actual rows=4.00 loops=N) Index Cond: (unique1 < 4) Index Searches: N -(15 rows) +(16 rows) -- And check we get the expected results. SELECT COUNT(*),AVG(t2.t1two) FROM tenk1 t1 LEFT JOIN @@ -149,13 +152,14 @@ -> Memoize (actual rows=1.00 loops=N) Cache Key: (t1.two + 1) Cache Mode: binary + Estimated Capacity: 2 Estimated Distinct Lookup Keys: 2 Hits: 998 Misses: 2 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using tenk1_unique1 on tenk1 t2 (actual rows=1.00 loops=N) Filter: ((t1.two + 1) = unique1) Rows Removed by Filter: 9999 Heap Fetches: N Index Searches: N -(14 rows) +(15 rows) -- And check we get the expected results. SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN @@ -182,11 +186,12 @@ -> Memoize (actual rows=1.00 loops=N) Cache Key: t1.two, t1.twenty Cache Mode: binary + Estimated Capacity: 40 Estimated Distinct Lookup Keys: 40 Hits: 980 Misses: 20 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Seq Scan on tenk1 t2 (actual rows=1.00 loops=N) Filter: ((t1.twenty = unique1) AND (t1.two = two)) Rows Removed by Filter: 9999 -(12 rows) +(13 rows) -- And check we get the expected results. SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN @@ -220,13 +225,14 @@ -> Memoize (actual rows=2.00 loops=N) Cache Key: t1.x, (t1.t)::numeric Cache Mode: logical + Estimated Capacity: 20 Estimated Distinct Lookup Keys: 20 Hits: 20 Misses: 20 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using expr_key_idx_x_t on expr_key t2 (actual rows=2.00 loops=N) Index Cond: (x = (t1.t)::numeric) Filter: (t1.x = (t)::numeric) Heap Fetches: N Index Searches: N -(11 rows) +(12 rows) DROP TABLE expr_key; -- Reduce work_mem and hash_mem_multiplier so that we see some cache evictions @@ -249,12 +255,13 @@ -> Memoize (actual rows=1.00 loops=N) Cache Key: t2.thousand Cache Mode: logical + Estimated Capacity: 655 Estimated Distinct Lookup Keys: 721 Hits: N Misses: N Evictions: N Overflows: 0 Memory Usage: NkB -> Index Only Scan using tenk1_unique1 on tenk1 t1 (actual rows=1.00 loops=N) Index Cond: (unique1 = t2.thousand) Heap Fetches: N Index Searches: N -(13 rows) +(14 rows) CREATE TABLE flt (f float); CREATE INDEX flt_f_idx ON flt (f); @@ -273,12 +280,13 @@ -> Memoize (actual rows=2.00 loops=N) Cache Key: f1.f Cache Mode: logical + Estimated Capacity: 1 Estimated Distinct Lookup Keys: 1 Hits: 1 Misses: 1 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using flt_f_idx on flt f2 (actual rows=2.00 loops=N) Index Cond: (f = f1.f) Heap Fetches: N Index Searches: N -(12 rows) +(13 rows) -- Ensure memoize operates in binary mode SELECT explain_memoize(' @@ -292,12 +300,13 @@ -> Memoize (actual rows=2.00 loops=N) Cache Key: f1.f Cache Mode: binary + Estimated Capacity: 1 Estimated Distinct Lookup Keys: 1 Hits: 0 Misses: 2 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using flt_f_idx on flt f2 (actual rows=2.00 loops=N) Index Cond: (f <= f1.f) Heap Fetches: N Index Searches: N -(12 rows) +(13 rows) DROP TABLE flt; -- Exercise Memoize in binary mode with a large fixed width type and a @@ -320,11 +329,12 @@ -> Memoize (actual rows=4.00 loops=N) Cache Key: s1.n Cache Mode: binary + Estimated Capacity: 3 Estimated Distinct Lookup Keys: 3 Hits: 3 Misses: 3 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Scan using strtest_n_idx on strtest s2 (actual rows=4.00 loops=N) Index Cond: (n <= s1.n) Index Searches: N -(10 rows) +(11 rows) -- Ensure we get 3 hits and 3 misses SELECT explain_memoize(' @@ -337,11 +347,12 @@ -> Memoize (actual rows=4.00 loops=N) Cache Key: s1.t Cache Mode: binary + Estimated Capacity: 4 Estimated Distinct Lookup Keys: 4 Hits: 3 Misses: 3 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Scan using strtest_t_idx on strtest s2 (actual rows=4.00 loops=N) Index Cond: (t <= s1.t) Index Searches: N -(10 rows) +(11 rows) DROP TABLE strtest; -- Ensure memoize works with partitionwise join @@ -366,6 +377,7 @@ -> Memoize (actual rows=4.00 loops=N) Cache Key: t1_1.a Cache Mode: logical + Estimated Capacity: 2 Estimated Distinct Lookup Keys: 2 Hits: 3 Misses: 1 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using iprt_p1_a on prt_p1 t2_1 (actual rows=4.00 loops=N) Index Cond: (a = t1_1.a) @@ -378,12 +390,13 @@ -> Memoize (actual rows=4.00 loops=N) Cache Key: t1_2.a Cache Mode: logical + Estimated Capacity: 2 Estimated Distinct Lookup Keys: 2 Hits: 3 Misses: 1 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using iprt_p2_a on prt_p2 t2_2 (actual rows=4.00 loops=N) Index Cond: (a = t1_2.a) Heap Fetches: N Index Searches: N -(25 rows) +(27 rows) -- Ensure memoize works with parameterized union-all Append path SET enable_partitionwise_join TO off; @@ -400,6 +413,7 @@ -> Memoize (actual rows=4.00 loops=N) Cache Key: t1.a Cache Mode: logical + Estimated Capacity: 1 Estimated Distinct Lookup Keys: 1 Hits: 3 Misses: 1 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Append (actual rows=4.00 loops=N) -> Index Only Scan using iprt_p1_a on prt_p1 (actual rows=4.00 loops=N) @@ -410,7 +424,7 @@ Index Cond: (a = t1.a) Heap Fetches: N Index Searches: N -(17 rows) +(18 rows) DROP TABLE prt; RESET enable_partitionwise_join;