| 456 | } /* ExecSortExplainEnd */ |
| 457 | |
| 458 | static void |
| 459 | ExecEagerFreeSort(SortState *node) |
| 460 | { |
| 461 | /* clean out the tuple table */ |
| 462 | ExecClearTuple(node->ss.ss_ScanTupleSlot); |
| 463 | |
| 464 | /* must drop pointer to sort result tuple */ |
| 465 | ExecClearTuple(node->ss.ps.ps_ResultTupleSlot); |
| 466 | |
| 467 | if (node->tuplesortstate != NULL) |
| 468 | { |
| 469 | /* |
| 470 | * Save stats like in ExecSortExplainEnd, so that we can display |
| 471 | * them later in EXPLAIN ANALYZE. |
| 472 | */ |
| 473 | tuplesort_get_stats(node->tuplesortstate, |
| 474 | &node->sortstats); |
| 475 | if (node->ss.ps.instrument) |
| 476 | { |
| 477 | node->ss.ps.instrument->workfileCreated = (node->sortstats.spaceType == SORT_SPACE_TYPE_DISK); |
| 478 | node->ss.ps.instrument->workmemused = node->sortstats.workmemused; |
| 479 | } |
| 480 | |
| 481 | tuplesort_end((Tuplesortstate *) node->tuplesortstate); |
| 482 | node->tuplesortstate = NULL; |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | void |
| 487 | ExecSquelchSort(SortState *node, bool force) |
no test coverage detected