---------------------------------------------------------------- * ExecReScanIndexOnlyScan(node) * * Recalculates the values of any scan keys whose value depends on * information known at runtime, then rescans the indexed relation. * * Updating the scan key was formerly done separately in * ExecUpdateIndexScanKeys. Integrating it into ReScan makes * rescans of indices and relations/g
| 330 | * ---------------------------------------------------------------- |
| 331 | */ |
| 332 | void |
| 333 | ExecReScanIndexOnlyScan(IndexOnlyScanState *node) |
| 334 | { |
| 335 | /* |
| 336 | * If we are doing runtime key calculations (ie, any of the index key |
| 337 | * values weren't simple Consts), compute the new key values. But first, |
| 338 | * reset the context so we don't leak memory as each outer tuple is |
| 339 | * scanned. Note this assumes that we will recalculate *all* runtime keys |
| 340 | * on each call. |
| 341 | */ |
| 342 | if (node->ioss_NumRuntimeKeys != 0) |
| 343 | { |
| 344 | ExprContext *econtext = node->ioss_RuntimeContext; |
| 345 | |
| 346 | ResetExprContext(econtext); |
| 347 | ExecIndexEvalRuntimeKeys(econtext, |
| 348 | node->ioss_RuntimeKeys, |
| 349 | node->ioss_NumRuntimeKeys); |
| 350 | } |
| 351 | node->ioss_RuntimeKeysReady = true; |
| 352 | |
| 353 | /* reset index scan */ |
| 354 | if (node->ioss_ScanDesc) |
| 355 | index_rescan(node->ioss_ScanDesc, |
| 356 | node->ioss_ScanKeys, node->ioss_NumScanKeys, |
| 357 | node->ioss_OrderByKeys, node->ioss_NumOrderByKeys); |
| 358 | |
| 359 | ExecScanReScan(&node->ss); |
| 360 | } |
| 361 | |
| 362 | |
| 363 | /* ---------------------------------------------------------------- |
no test coverage detected