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.
This commit is contained in:
Tom Lane 2006-02-26 22:58:12 +00:00
parent e1f06d8057
commit 909ca1407c
2 changed files with 608 additions and 410 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeSort.c,v 1.52 2005/11/23 20:27:57 tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/nodeSort.c,v 1.53 2006/02/26 22:58:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -225,6 +225,8 @@ ExecEndSort(SortState *node)
* clean out the tuple table
*/
ExecClearTuple(node->ss.ss_ScanTupleSlot);
/* must drop pointer to sort result tuple */
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
/*
* Release tuplesort resources
@ -292,6 +294,7 @@ ExecReScanSort(SortState *node, ExprContext *exprCtxt)
if (!node->sort_Done)
return;
/* must drop pointer to sort result tuple */
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
/*

File diff suppressed because it is too large Load Diff