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

Function AssignGangs

src/backend/executor/execUtils.c:1823–1840  ·  view source on GitHub ↗

* Function AssignGangs runs on the QD and finishes construction of the * global slice table for a plan by assigning gangs allocated by the * executor factory to the slices of the slice table. * * On entry, the executor slice table (at queryDesc->estate->es_sliceTable) * has been initialized and has correct (by InitSliceTable function) * * Gang assignment involves taking an inventory of the

Source from the content-addressed store, hash-verified

1821 * slice in the slice table.
1822 */
1823void
1824AssignGangs(CdbDispatcherState *ds, QueryDesc *queryDesc)
1825{
1826 SliceTable *sliceTable;
1827 EState *estate;
1828 int rootIdx;
1829
1830 estate = queryDesc->estate;
1831 sliceTable = estate->es_sliceTable;
1832 rootIdx = RootSliceIndex(queryDesc->estate);
1833
1834 /* cleanup processMap because initPlan and main Plan share the same slice table */
1835 for (int i = 0; i < sliceTable->numSlices; i++)
1836 sliceTable->slices[i].processesMap = NULL;
1837
1838 AssignWriterGangFirst(ds, sliceTable, rootIdx);
1839 InventorySliceTree(ds, sliceTable, rootIdx);
1840}
1841
1842/*
1843 * AssignWriterGangFirst() - Try to assign writer gang first.

Callers 1

cdbdisp_dispatchXFunction · 0.85

Calls 3

RootSliceIndexFunction · 0.85
AssignWriterGangFirstFunction · 0.85
InventorySliceTreeFunction · 0.85

Tested by

no test coverage detected