-- Cause some overflow insert and splits.
--
CREATE TABLE hash_split_heap (keycol INT);
+INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 500) a;
CREATE INDEX hash_split_index on hash_split_heap USING HASH (keycol);
-INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 70000) a;
-VACUUM FULL hash_split_heap;
+INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 5000) a;
-- Let's do a backward scan.
BEGIN;
SET enable_seqscan = OFF;
MOVE BACKWARD ALL FROM c;
CLOSE c;
END;
--- DELETE, INSERT, REBUILD INDEX.
+-- DELETE, INSERT, VACUUM.
DELETE FROM hash_split_heap WHERE keycol = 1;
-INSERT INTO hash_split_heap SELECT a/2 FROM generate_series(1, 50000) a;
+INSERT INTO hash_split_heap SELECT a/2 FROM generate_series(1, 25000) a;
VACUUM hash_split_heap;
-REINDEX INDEX hash_split_index;
-- Clean up.
DROP TABLE hash_split_heap;
-- Index on temp table.
-- Cause some overflow insert and splits.
--
CREATE TABLE hash_split_heap (keycol INT);
+INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 500) a;
CREATE INDEX hash_split_index on hash_split_heap USING HASH (keycol);
-INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 70000) a;
-
-VACUUM FULL hash_split_heap;
+INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 5000) a;
-- Let's do a backward scan.
BEGIN;
CLOSE c;
END;
--- DELETE, INSERT, REBUILD INDEX.
+-- DELETE, INSERT, VACUUM.
DELETE FROM hash_split_heap WHERE keycol = 1;
-INSERT INTO hash_split_heap SELECT a/2 FROM generate_series(1, 50000) a;
+INSERT INTO hash_split_heap SELECT a/2 FROM generate_series(1, 25000) a;
VACUUM hash_split_heap;
-REINDEX INDEX hash_split_index;
-- Clean up.
DROP TABLE hash_split_heap;