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

Lines changed: 4 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy