-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: SQL Stats cleanup job too slow #79548
Copy link
Copy link
Closed
Labels
A-sql-observabilityRelated to observability of the SQL layerRelated to observability of the SQL layerC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Description
We have observed that sometimes SQL Stats cleanup job runs way too slow. (sometimes 12 hours+). This can be problematic when the are sql stats flush rate is high. We need to find a way to speed up SQL Stats cleanup job.
cc: @ajwerner
Update: action items: (cc @mgartner )
- Knob to tune the 128 row limit.
- Update the query to skip over garbage.
- Add timestamp filter to query to prevent deleting too many rows.
- Remove the initial count query and instead have the for loop delete queries until < 128 (or the setting value) are deleted.
- Partially addressed by sql: ensure SQL Stats cleanup job to not interfere with foreground traffic #80515
- Consider increasing the number of shards in the two tables in future versions.
Jira issue: CRDB-14902
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-observabilityRelated to observability of the SQL layerRelated to observability of the SQL layerC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.