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

Commitff28809

Browse files
committed
Code review for dynahash change.
Commitbe0a666 left behind a comment about the order of some tests thatdidn't make sense without the expensive division, and in fact we mightas well change the order to one that fails more cheaply most of the timeas a micro-optimization. Also, remove the "+ 1" applied to max_bucket,to drop an instruction and match the original behavior. Per reviewfrom Tom Lane.Discussion:https://postgr.es/m/VI1PR0701MB696044FC35013A96FECC7AC8F62D0%40VI1PR0701MB6960.eurprd07.prod.outlook.com
1 parentbe0a666 commitff28809

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎src/backend/utils/hash/dynahash.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -963,11 +963,10 @@ hash_search_with_hash_value(HTAB *hashp,
963963
{
964964
/*
965965
* Can't split if running in partitioned mode, nor if frozen, nor if
966-
* table is the subject of any active hash_seq_search scans. Strange
967-
* order of these tests is to try to check cheaper conditions first.
966+
* table is the subject of any active hash_seq_search scans.
968967
*/
969-
if (!IS_PARTITIONED(hctl)&& !hashp->frozen&&
970-
hctl->freeList[0].nentries> (long) (hctl->max_bucket+1)&&
968+
if (hctl->freeList[0].nentries> (long)hctl->max_bucket&&
969+
!IS_PARTITIONED(hctl)&& !hashp->frozen&&
971970
!has_seq_scans(hashp))
972971
(void)expand_table(hashp);
973972
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp