Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 909ca14

Browse files
committed
Improve sorting speed by pre-extracting the first sort-key column of
each tuple, as per my proposal of several days ago. Also, clean up sort memory management by keeping all working data in a separate memory context, and refine the handling of low-memory conditions.
1 parent e1f06d8 commit 909ca14

File tree

2 files changed

+604
-406
lines changed

2 files changed

+604
-406
lines changed

src/backend/executor/nodeSort.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeSort.c,v 1.52 2005/11/23 20:27:57 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeSort.c,v 1.53 2006/02/26 22:58:12 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -225,6 +225,8 @@ ExecEndSort(SortState *node)
225225
* clean out the tuple table
226226
*/
227227
ExecClearTuple(node->ss.ss_ScanTupleSlot);
228+
/* must drop pointer to sort result tuple */
229+
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
228230

229231
/*
230232
* Release tuplesort resources
@@ -292,6 +294,7 @@ ExecReScanSort(SortState *node, ExprContext *exprCtxt)
292294
if (!node->sort_Done)
293295
return;
294296

297+
/* must drop pointer to sort result tuple */
295298
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
296299

297300
/*

0 commit comments

Comments
 (0)