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

Function ExecNextDynamicIndexScan

src/backend/executor/execDynamicIndexes.c:258–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258TupleTableSlot *
259ExecNextDynamicIndexScan(DynamicIndexScanState *node)
260{
261 TupleTableSlot *slot = NULL;
262
263 /*
264 * Scan index to find next tuple to return. If the current index is
265 * exhausted, close it and open the next index for scan.
266 */
267 for (;;)
268 {
269 if (!initNextIndexToScan(node))
270 return NULL;
271
272 Assert((node->indexScanState == NULL && node->indexOnlyScanState != NULL) ||
273 (node->indexScanState != NULL && node->indexOnlyScanState == NULL));
274
275 if (node->indexScanState)
276 slot = ExecProcNode(&node->indexScanState->ss.ps);
277 else if (node->indexOnlyScanState)
278 slot = ExecProcNode(&node->indexOnlyScanState->ss.ps);
279 else
280 return NULL;
281
282 if (TupIsNull(slot))
283 {
284 endCurrentIndexScan(node);
285
286 node->scan_state = SCAN_INIT;
287 }
288 else
289 break;
290 }
291 return slot;
292}
293
294/*
295 * Release resources of DynamicIndexScan

Callers 2

ExecDynamicIndexScanFunction · 0.85
ExecDynamicIndexOnlyScanFunction · 0.85

Calls 3

initNextIndexToScanFunction · 0.85
ExecProcNodeFunction · 0.85
endCurrentIndexScanFunction · 0.85

Tested by

no test coverage detected