-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Save index recommendations per statement fingerprint id #83782
Copy link
Copy link
Closed
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Description
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 totrueindicating 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 asfalse - 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)