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

Commitd2825e1

Browse files
committed
Since sort_bounded_heap makes state changes that should be made
regardless of the number of tuples involved, it's incorrect to skip itwhen memtupcount = 1; the number of cycles saved is minuscule anyway.An alternative solution would be to pull the state changes out to thecall site in tuplesort_performsort, but keeping them near the correspondingchanges in make_bounded_heap seems marginally cleaner. Noticed byGreg Stark.
1 parent0ee5a39 commitd2825e1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
* Portions Copyright (c) 1994, Regents of the University of California
9292
*
9393
* IDENTIFICATION
94-
* $PostgreSQL: pgsql/src/backend/utils/sort/tuplesort.c,v 1.77 2007/06/07 19:19:57 tgl Exp $
94+
* $PostgreSQL: pgsql/src/backend/utils/sort/tuplesort.c,v 1.78 2007/09/01 18:47:39 tgl Exp $
9595
*
9696
*-------------------------------------------------------------------------
9797
*/
@@ -1068,8 +1068,7 @@ tuplesort_performsort(Tuplesortstate *state)
10681068
* in memory, using a heap to eliminate excess tuples. Now we have
10691069
* to transform the heap to a properly-sorted array.
10701070
*/
1071-
if (state->memtupcount>1)
1072-
sort_bounded_heap(state);
1071+
sort_bounded_heap(state);
10731072
state->current=0;
10741073
state->eof_reached= false;
10751074
state->markpos_offset=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp