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

Commit606ccc5

Browse files
committed
Improve test case exercising the sorting path for hash index build.
On second thought, we should probably do at least a minimal check thatthe constructed index is valid, since the big problem with the mostrecent breakage was not whether the sorting was correct but that theindex had incorrect hash codes placed in it.
1 parent9563d5b commit606ccc5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,6 +2351,23 @@ DROP TABLE unlogged_hash_table;
23512351
SET maintenance_work_mem = '1MB';
23522352
CREATE INDEX hash_tuplesort_idx ON tenk1 USING hash (stringu1 name_ops) WITH (fillfactor = 10);
23532353
WARNING: hash indexes are not WAL-logged and their use is discouraged
2354+
EXPLAIN (COSTS OFF)
2355+
SELECT count(*) FROM tenk1 WHERE stringu1 = 'TVAAAA';
2356+
QUERY PLAN
2357+
-------------------------------------------------------
2358+
Aggregate
2359+
-> Bitmap Heap Scan on tenk1
2360+
Recheck Cond: (stringu1 = 'TVAAAA'::name)
2361+
-> Bitmap Index Scan on hash_tuplesort_idx
2362+
Index Cond: (stringu1 = 'TVAAAA'::name)
2363+
(5 rows)
2364+
2365+
SELECT count(*) FROM tenk1 WHERE stringu1 = 'TVAAAA';
2366+
count
2367+
-------
2368+
14
2369+
(1 row)
2370+
23542371
DROP INDEX hash_tuplesort_idx;
23552372
RESET maintenance_work_mem;
23562373
--

‎src/test/regress/sql/create_index.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,9 @@ DROP TABLE unlogged_hash_table;
694694
-- maintenance_work_mem setting and fillfactor:
695695
SET maintenance_work_mem='1MB';
696696
CREATEINDEXhash_tuplesort_idxON tenk1 USING hash (stringu1 name_ops) WITH (fillfactor=10);
697+
EXPLAIN (COSTS OFF)
698+
SELECTcount(*)FROM tenk1WHERE stringu1='TVAAAA';
699+
SELECTcount(*)FROM tenk1WHERE stringu1='TVAAAA';
697700
DROPINDEX hash_tuplesort_idx;
698701
RESET maintenance_work_mem;
699702

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp