MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecSortEstimate

Function ExecSortEstimate

src/backend/executor/nodeSort.c:508–521  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecSortEstimate * * Estimate space required to propagate sort statistics. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

506 * ----------------------------------------------------------------
507 */
508void
509ExecSortEstimate(SortState *node, ParallelContext *pcxt)
510{
511 Size size;
512
513 /* don't need this if not instrumenting or no workers */
514 if (!node->ss.ps.instrument || pcxt->nworkers == 0)
515 return;
516
517 size = mul_size(pcxt->nworkers, sizeof(TuplesortInstrumentation));
518 size = add_size(size, offsetof(SharedSortInfo, sinstrument));
519 shm_toc_estimate_chunk(&pcxt->estimator, size);
520 shm_toc_estimate_keys(&pcxt->estimator, 1);
521}
522
523/* ----------------------------------------------------------------
524 * ExecSortInitializeDSM

Callers 2

ExecParallelEstimateFunction · 0.85

Calls 2

mul_sizeFunction · 0.85
add_sizeFunction · 0.85

Tested by

no test coverage detected