Collect index recommendations per fingerprint id.
We don't want to collect recommendation for all executions, so only calculate if there is no recommendations calculated in-memory so far. Steps:
- Statement is executed
- Check if there is a recommendation in-memory (crdb_internal.cluster_statement_statistics)
2a. If there isn't one, set a new flag to true indicating it should be calculated, and update here to also check this flag, calculate the recommendation and save in-memory
2b. If there is one, keep the flag as false
- When the data in-memory flushed, replace the value persisted, with the latest value from memory
This solution keep the recommendations updated, and also doesn't generate a problem by calculating on every execution.
Challenge: since I'll calculate the rec the first time is added to in-memory, this means after a flush, there will be a spike on calculation, since everything will be new in-memory. Need to find a way to spread the calculation on the 10min period
Jira issue: CRDB-17261
Collect index recommendations per fingerprint id.
We don't want to collect recommendation for all executions, so only calculate if there is no recommendations calculated in-memory so far. Steps:
2a. If there isn't one, set a new flag to
trueindicating it should be calculated, and update here to also check this flag, calculate the recommendation and save in-memory2b. If there is one, keep the flag as
falseThis solution keep the recommendations updated, and also doesn't generate a problem by calculating on every execution.
Challenge: since I'll calculate the rec the first time is added to in-memory, this means after a flush, there will be a spike on calculation, since everything will be new in-memory. Need to find a way to spread the calculation on the 10min period
Jira issue: CRDB-17261