* This function initializes a part and returns true if a new index has been prepared for scanning. */
| 225 | * This function initializes a part and returns true if a new index has been prepared for scanning. |
| 226 | */ |
| 227 | static bool |
| 228 | initNextIndexToScan(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 | |
| 258 | TupleTableSlot * |
| 259 | ExecNextDynamicIndexScan(DynamicIndexScanState *node) |
no test coverage detected