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

Commitf83b610

Browse files
author
Maxim Orlov
committed
Use vanilla tuplesort_free call.
1 parentaf616a0 commitf83b610

File tree

1 file changed

+1
-49
lines changed

1 file changed

+1
-49
lines changed

‎src/rumsort.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -347,55 +347,7 @@ rum_tuplesort_begin_rumitem(int workMem, FmgrInfo *cmp)
347347
void
348348
rum_tuplesort_end(RumTuplesortstate*state)
349349
{
350-
/* context swap probably not needed, but let's be safe */
351-
MemoryContextoldcontext=MemoryContextSwitchTo(state->sortcontext);
352-
353-
#ifdefTRACE_SORT
354-
longspaceUsed;
355-
356-
if (state->tapeset)
357-
spaceUsed=LogicalTapeSetBlocks(state->tapeset);
358-
else
359-
spaceUsed= (state->allowedMem-state->availMem+1023) /1024;
360-
#endif
361-
362-
/*
363-
* Delete temporary "tape" files, if any.
364-
*
365-
* Note: want to include this in reported total cost of sort, hence need
366-
* for two #ifdef TRACE_SORT sections.
367-
*/
368-
if (state->tapeset)
369-
LogicalTapeSetClose(state->tapeset);
370-
371-
#ifdefTRACE_SORT
372-
if (trace_sort)
373-
{
374-
if (state->tapeset)
375-
elog(LOG,"external sort ended, %ld disk blocks used: %s",
376-
spaceUsed,pg_rusage_show(&state->ru_start));
377-
else
378-
elog(LOG,"internal sort ended, %ld KB used: %s",
379-
spaceUsed,pg_rusage_show(&state->ru_start));
380-
}
381-
#endif
382-
383-
/* Free any execution state created for CLUSTER case */
384-
if (state->estate!=NULL)
385-
{
386-
ExprContext*econtext=GetPerTupleExprContext(state->estate);
387-
388-
ExecDropSingleTupleTableSlot(econtext->ecxt_scantuple);
389-
FreeExecutorState(state->estate);
390-
}
391-
392-
MemoryContextSwitchTo(oldcontext);
393-
394-
/*
395-
* Free the per-sort memory context, thereby releasing all working memory,
396-
* including the Tuplesortstate struct itself.
397-
*/
398-
MemoryContextDelete(state->sortcontext);
350+
tuplesort_free(state);
399351
}
400352

401353
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp