Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4a8bc39

Browse files
committed
Speed up hash_index regression test.
Commitf5ab0a1 made this test take substantially longer than it usedto. With a bit more care, we can get the runtime back down whileachieving the same, or even a bit better, code coverage.Mithun CyDiscussion:https://postgr.es/m/CAD__Ouh-qaEb+rD7Uy-4g3xQYOrhPzHs-a_TrFAjiQ5azAW5+w@mail.gmail.com
1 parent16ebab6 commit4a8bc39

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

‎src/test/regress/expected/hash_index.out

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ SELECT h.seqno AS f20000
200200
-- Cause some overflow insert and splits.
201201
--
202202
CREATE TABLE hash_split_heap (keycol INT);
203+
INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 500) a;
203204
CREATE INDEX hash_split_index on hash_split_heap USING HASH (keycol);
204-
INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 70000) a;
205-
VACUUM FULL hash_split_heap;
205+
INSERT INTO hash_split_heap SELECT 1 FROM generate_series(1, 5000) a;
206206
-- Let's do a backward scan.
207207
BEGIN;
208208
SET enable_seqscan = OFF;
@@ -213,11 +213,10 @@ MOVE BACKWARD 10000 FROM c;
213213
MOVE BACKWARD ALL FROM c;
214214
CLOSE c;
215215
END;
216-
-- DELETE, INSERT,REBUILD INDEX.
216+
-- DELETE, INSERT,VACUUM.
217217
DELETE FROM hash_split_heap WHERE keycol = 1;
218-
INSERT INTO hash_split_heap SELECT a/2 FROM generate_series(1,50000) a;
218+
INSERT INTO hash_split_heap SELECT a/2 FROM generate_series(1,25000) a;
219219
VACUUM hash_split_heap;
220-
REINDEX INDEX hash_split_index;
221220
-- Clean up.
222221
DROP TABLE hash_split_heap;
223222
-- Index on temp table.

‎src/test/regress/sql/hash_index.sql

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,9 @@ SELECT h.seqno AS f20000
156156
-- Cause some overflow insert and splits.
157157
--
158158
CREATETABLEhash_split_heap (keycolINT);
159+
INSERT INTO hash_split_heapSELECT1FROM generate_series(1,500) a;
159160
CREATEINDEXhash_split_indexon hash_split_heap USING HASH (keycol);
160-
INSERT INTO hash_split_heapSELECT1FROM generate_series(1,70000) a;
161-
162-
VACUUM FULL hash_split_heap;
161+
INSERT INTO hash_split_heapSELECT1FROM generate_series(1,5000) a;
163162

164163
-- Let's do a backward scan.
165164
BEGIN;
@@ -173,12 +172,11 @@ MOVE BACKWARD ALL FROM c;
173172
CLOSE c;
174173
END;
175174

176-
-- DELETE, INSERT,REBUILD INDEX.
175+
-- DELETE, INSERT,VACUUM.
177176
DELETEFROM hash_split_heapWHERE keycol=1;
178-
INSERT INTO hash_split_heapSELECT a/2FROM generate_series(1,50000) a;
177+
INSERT INTO hash_split_heapSELECT a/2FROM generate_series(1,25000) a;
179178

180179
VACUUM hash_split_heap;
181-
REINDEX INDEX hash_split_index;
182180

183181
-- Clean up.
184182
DROPTABLE hash_split_heap;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp