use-fewer-blocks.patch.nocfbot
application/octet-stream
Filename: use-fewer-blocks.patch.nocfbot
Type: application/octet-stream
Part: 0
diff --git a/src/test/modules/test_tidstore/expected/test_tidstore.out b/src/test/modules/test_tidstore/expected/test_tidstore.out
index 8ee05bc772..5cd70b6c50 100644
--- a/src/test/modules/test_tidstore/expected/test_tidstore.out
+++ b/src/test/modules/test_tidstore/expected/test_tidstore.out
@@ -10,9 +10,7 @@ CREATE TEMP TABLE hideblocks(blockno bigint);
-- The maximum number of heap tuples (MaxHeapTuplesPerPage) in 8kB block is 291.
-- We use a higher number to test tidstore.
\set maxoffset 512
--- Create a TID store in shared memory. We can't do that for for the radix tree
--- tests, because unused static functions would raise warnings there.
-SELECT test_create(true);
+SELECT test_create(false);
test_create
-------------
@@ -50,11 +48,12 @@ SELECT do_set_block_offsets(blk, array_agg(offsets.off)::int2[])
4294967295
(5 rows)
--- Add enough TIDs to cause allocation of an additional DSM segment
--- when using shared memory.
+-- Add enough TIDs to cause the store to appear "full", compared
+-- to the allocated memory it started out with. This is easier
+-- with memory contexts in local memory.
INSERT INTO hideblocks (blockno)
SELECT do_set_block_offsets(blk, ARRAY[1,31,32,63,64,200]::int2[])
- FROM generate_series(1000, 20000, 1) blk;
+ FROM generate_series(1000, 2000, 1) blk;
-- Zero offset not allowed
SELECT do_set_block_offsets(1, ARRAY[0]::int2[]);
ERROR: tuple offset out of range: 0
@@ -72,6 +71,8 @@ SELECT test_is_full();
(1 row)
-- Re-create the TID store for randommized tests.
+-- Use shared memory this time. We can't do that for for the radix tree
+-- tests, because unused static functions would raise warnings there.
SELECT test_destroy();
test_destroy
--------------
diff --git a/src/test/modules/test_tidstore/sql/test_tidstore.sql b/src/test/modules/test_tidstore/sql/test_tidstore.sql
index 4ffdf3e7b5..482fc94738 100644
--- a/src/test/modules/test_tidstore/sql/test_tidstore.sql
+++ b/src/test/modules/test_tidstore/sql/test_tidstore.sql
@@ -14,9 +14,7 @@ CREATE TEMP TABLE hideblocks(blockno bigint);
-- We use a higher number to test tidstore.
\set maxoffset 512
--- Create a TID store in shared memory. We can't do that for for the radix tree
--- tests, because unused static functions would raise warnings there.
-SELECT test_create(true);
+SELECT test_create(false);
-- Test on empty tidstore.
SELECT test_is_full();
@@ -33,11 +31,12 @@ SELECT do_set_block_offsets(blk, array_agg(offsets.off)::int2[])
FROM blocks, offsets
GROUP BY blk;
--- Add enough TIDs to cause allocation of an additional DSM segment
--- when using shared memory.
+-- Add enough TIDs to cause the store to appear "full", compared
+-- to the allocated memory it started out with. This is easier
+-- with memory contexts in local memory.
INSERT INTO hideblocks (blockno)
SELECT do_set_block_offsets(blk, ARRAY[1,31,32,63,64,200]::int2[])
- FROM generate_series(1000, 20000, 1) blk;
+ FROM generate_series(1000, 2000, 1) blk;
-- Zero offset not allowed
SELECT do_set_block_offsets(1, ARRAY[0]::int2[]);
@@ -49,6 +48,8 @@ SELECT test_is_full();
-- Re-create the TID store for randommized tests.
SELECT test_destroy();
+-- Use shared memory this time. We can't do that in test_radixtree.sql,
+-- because unused static functions would raise warnings there.
SELECT test_create(true);
-- Random TIDs test. We insert TIDs for 1000 blocks. Each block has