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:
parent
e1f06d8057
commit
909ca1407c
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* clean out the tuple table
|
||||||
*/
|
*/
|
||||||
ExecClearTuple(node->ss.ss_ScanTupleSlot);
|
ExecClearTuple(node->ss.ss_ScanTupleSlot);
|
||||||
|
/* must drop pointer to sort result tuple */
|
||||||
|
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Release tuplesort resources
|
* Release tuplesort resources
|
||||||
@ -292,6 +294,7 @@ ExecReScanSort(SortState *node, ExprContext *exprCtxt)
|
|||||||
if (!node->sort_Done)
|
if (!node->sort_Done)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* must drop pointer to sort result tuple */
|
||||||
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
|
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user