Based on the task start time it checks if we have exceeded the ttl task budget defined in * the SingleTTLTaskTimeBudget GUC. */
| 573 | /* Based on the task start time it checks if we have exceeded the ttl task budget defined in |
| 574 | * the SingleTTLTaskTimeBudget GUC. */ |
| 575 | static bool |
| 576 | IsTaskTimeBudgetExceeded(instr_time startTime, double *elapsedTime, int budget) |
| 577 | { |
| 578 | instr_time current; |
| 579 | INSTR_TIME_SET_CURRENT(current); |
| 580 | INSTR_TIME_SUBTRACT(current, startTime); |
| 581 | double elapsed = INSTR_TIME_GET_MILLISEC(current); |
| 582 | |
| 583 | if (elapsedTime != NULL) |
| 584 | { |
| 585 | *elapsedTime = elapsed; |
| 586 | } |
| 587 | |
| 588 | if (elapsed > (double) budget) |
| 589 | { |
| 590 | ereport(LOG, errmsg("TTL Index delete rows exceeded time budget: %dms.", |
| 591 | budget)); |
| 592 | return true; |
| 593 | } |
| 594 | |
| 595 | return false; |
| 596 | } |
| 597 | |
| 598 | |
| 599 | /* Deletes the rows that have expired for the given table name and ttl entry information. |
no outgoing calls
no test coverage detected