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

Commit5da8bf8

Browse files
Avoid CREATE INDEX unique index deduplication.
There is no advantage to attempting deduplication for a unique indexduring CREATE INDEX, since there cannot possibly be any duplicates.Doing so wastes cycles due to unnecessary copying. Make sure that weavoid it consistently.We already avoided unique index deduplication in the case where therewere some spool2 tuples to merge. That didn't account for the fact thatspool2 is removed early/unset in the common case where it has no tuplesthat need to be merged (i.e. it failed to account for the "spool2 turnsout to be unnecessary" optimization in _bt_spools_heapscan()).Oversight in commit0d861bb, which added nbtree deduplicationBackpatch: 13-, where nbtree deduplication was introduced.
1 parent7fe3083 commit5da8bf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
11921192
int64tuples_done=0;
11931193
booldeduplicate;
11941194

1195-
deduplicate=wstate->inskey->allequalimage&&
1195+
deduplicate=wstate->inskey->allequalimage&& !btspool->isunique&&
11961196
BTGetDeduplicateItems(wstate->index);
11971197

11981198
if (merge)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp