From 5cdd6d8b0c99aca1803d89342e7659522f16b685 Mon Sep 17 00:00:00 2001 From: Andrey Borodin Date: Fri, 21 Aug 2026 16:27:42 +0300 Subject: [PATCH] Make Memoize eviction test work on 32-bit builds The test uses the minimum work_mem setting, but 1000 small cache entries can still fit on 32-bit builds. It then reports no evictions and fails the expected-output check. Count the whole inner tuple so that Memoize has to cache enough data to exercise eviction on both 32-bit and 64-bit builds. --- src/test/regress/expected/memoize.out | 11 +++++------ src/test/regress/sql/memoize.sql | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/test/regress/expected/memoize.out b/src/test/regress/expected/memoize.out index 218972dfab8..fe81655e2a4 100644 --- a/src/test/regress/expected/memoize.out +++ b/src/test/regress/expected/memoize.out @@ -237,11 +237,11 @@ SET hash_mem_multiplier TO 1.0; -- here as the number of entries that fit in the cache at once will vary -- between different machines. SELECT explain_memoize(' -SELECT COUNT(*),AVG(t1.unique1) FROM tenk1 t1 +SELECT COUNT(t1),AVG(t1.unique1) FROM tenk1 t1 INNER JOIN tenk1 t2 ON t1.unique1 = t2.thousand WHERE t2.unique1 < 1200;', true); - explain_memoize ----------------------------------------------------------------------------------------------- + explain_memoize +----------------------------------------------------------------------------------------- Aggregate (actual rows=1.00 loops=N) -> Nested Loop (actual rows=1200.00 loops=N) -> Seq Scan on tenk1 t2 (actual rows=1200.00 loops=N) @@ -251,11 +251,10 @@ WHERE t2.unique1 < 1200;', true); Cache Key: t2.thousand Cache Mode: logical 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 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) +(12 rows) CREATE TABLE flt (f float); CREATE INDEX flt_f_idx ON flt (f); diff --git a/src/test/regress/sql/memoize.sql b/src/test/regress/sql/memoize.sql index e39bbb65391..6abb0fec4e6 100644 --- a/src/test/regress/sql/memoize.sql +++ b/src/test/regress/sql/memoize.sql @@ -129,7 +129,7 @@ SET hash_mem_multiplier TO 1.0; -- here as the number of entries that fit in the cache at once will vary -- between different machines. SELECT explain_memoize(' -SELECT COUNT(*),AVG(t1.unique1) FROM tenk1 t1 +SELECT COUNT(t1),AVG(t1.unique1) FROM tenk1 t1 INNER JOIN tenk1 t2 ON t1.unique1 = t2.thousand WHERE t2.unique1 < 1200;', true);