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

Commitb360e0f

Browse files
committed
Make tuplesort_set_bound() assertions more comprehensible, hopefully.
Add the comments that I griped were missing. Also re-order testsso that parallelism-related tests aren't randomly separated fromeach other.Discussion:https://postgr.es/m/CAAaqYe9GD__4Crm=ddz+-XXcNhfY_V5gFYdLdmkFNq=2VHO56Q@mail.gmail.com
1 parentbac2fae commitb360e0f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎src/backend/utils/sort/tuplesort.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,20 +1187,21 @@ tuplesort_set_bound(Tuplesortstate *state, int64 bound)
11871187
{
11881188
/* Assert we're called before loading any tuples */
11891189
Assert(state->status==TSS_INITIAL&&state->memtupcount==0);
1190-
1190+
/* Can't set the bound twice, either */
11911191
Assert(!state->bounded);
1192+
/* Also, this shouldn't be called in a parallel worker */
11921193
Assert(!WORKER(state));
11931194

1195+
/* Parallel leader allows but ignores hint */
1196+
if (LEADER(state))
1197+
return;
1198+
11941199
#ifdefDEBUG_BOUNDED_SORT
11951200
/* Honor GUC setting that disables the feature (for easy testing) */
11961201
if (!optimize_bounded_sort)
11971202
return;
11981203
#endif
11991204

1200-
/* Parallel leader ignores hint */
1201-
if (LEADER(state))
1202-
return;
1203-
12041205
/* We want to be able to compute bound * 2, so limit the setting */
12051206
if (bound> (int64) (INT_MAX /2))
12061207
return;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp