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

Commitaefa6d1

Browse files
committed
Add some CHECK_FOR_INTERRUPTS() calls to the heap-sort call path.
I broke this in commit337b6f5, whichamong other things arranged for quicksorts to CHECK_FOR_INTERRUPTS()slightly less frequently. Sadly, it also arranged for heapsorts toCHECK_FOR_INTERRUPTS() much less frequently. Repair.
1 parent64c6048 commitaefa6d1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,7 @@ puttuple_common(Tuplesortstate *state, SortTuple *tuple)
11681168
{
11691169
/* new tuple <= top of the heap, so we can discard it */
11701170
free_sort_tuple(state,tuple);
1171+
CHECK_FOR_INTERRUPTS();
11711172
}
11721173
else
11731174
{
@@ -2431,6 +2432,7 @@ make_bounded_heap(Tuplesortstate *state)
24312432
{
24322433
/* New tuple would just get thrown out, so skip it */
24332434
free_sort_tuple(state,&state->memtuples[i]);
2435+
CHECK_FOR_INTERRUPTS();
24342436
}
24352437
else
24362438
{
@@ -2518,6 +2520,8 @@ tuplesort_heap_insert(Tuplesortstate *state, SortTuple *tuple,
25182520
memtuples=state->memtuples;
25192521
Assert(state->memtupcount<state->memtupsize);
25202522

2523+
CHECK_FOR_INTERRUPTS();
2524+
25212525
/*
25222526
* Sift-up the new entry, per Knuth 5.2.3 exercise 16. Note that Knuth is
25232527
* using 1-based array indexes, not 0-based.
@@ -2549,6 +2553,9 @@ tuplesort_heap_siftup(Tuplesortstate *state, bool checkIndex)
25492553

25502554
if (--state->memtupcount <=0)
25512555
return;
2556+
2557+
CHECK_FOR_INTERRUPTS();
2558+
25522559
n=state->memtupcount;
25532560
tuple=&memtuples[n];/* tuple that must be reinserted */
25542561
i=0;/* i is where the "hole" is */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp