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

Function ExecIncrementalSortEstimate

src/backend/executor/nodeIncrementalSort.c:1189–1202  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1187 * ----------------------------------------------------------------
1188 */
1189void
1190ExecIncrementalSortEstimate(IncrementalSortState *node, ParallelContext *pcxt)
1191{
1192 Size size;
1193
1194 /* don't need this if not instrumenting or no workers */
1195 if (!node->ss.ps.instrument || pcxt->nworkers == 0)
1196 return;
1197
1198 size = mul_size(pcxt->nworkers, sizeof(IncrementalSortInfo));
1199 size = add_size(size, offsetof(SharedIncrementalSortInfo, sinfo));
1200 shm_toc_estimate_chunk(&pcxt->estimator, size);
1201 shm_toc_estimate_keys(&pcxt->estimator, 1);
1202}
1203
1204/* ----------------------------------------------------------------
1205 * ExecSortInitializeDSM

Callers 1

ExecParallelEstimateFunction · 0.85

Calls 2

mul_sizeFunction · 0.85
add_sizeFunction · 0.85

Tested by

no test coverage detected