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

Function initNextIndexToScan

src/backend/executor/execDynamicIndexes.c:227–256  ·  view source on GitHub ↗

* This function initializes a part and returns true if a new index has been prepared for scanning. */

Source from the content-addressed store, hash-verified

225 * This function initializes a part and returns true if a new index has been prepared for scanning.
226 */
227static bool
228initNextIndexToScan(DynamicIndexScanState *node)
229{
230 EState *estate = node->ss.ps.state;
231
232 /* Load new index when the scanning of the previous index is done. */
233 if (node->scan_state == SCAN_INIT ||
234 node->scan_state == SCAN_DONE)
235 {
236 /* This is the oid of a partition of the table (*not* index) */
237 Oid tableOid;
238
239 if (++node->whichPart < node->nOids)
240 tableOid = node->partOids[node->whichPart];
241 else
242 return false;
243
244 /* Collect number of partitions scanned in EXPLAIN ANALYZE */
245 if (node->ss.ps.instrument)
246 node->ss.ps.instrument->numPartScanned++;
247
248 endCurrentIndexScan(node);
249
250 beginCurrentIndexScan(node, estate, tableOid);
251
252 node->scan_state = SCAN_SCAN;
253 }
254
255 return true;
256}
257
258TupleTableSlot *
259ExecNextDynamicIndexScan(DynamicIndexScanState *node)

Callers 1

ExecNextDynamicIndexScanFunction · 0.85

Calls 2

endCurrentIndexScanFunction · 0.85
beginCurrentIndexScanFunction · 0.85

Tested by

no test coverage detected