sql/opt: index recommendations can significantly increase planning time #131544
Labels
A-sql-observability
Related to observability of the SQL layer
A-sql-optimizer
SQL logical planning and optimizations.
branch-release-23.2
Used to mark GA and release blockers, technical advisories, and bugs for 23.2
branch-release-24.1
Used to mark GA and release blockers, technical advisories, and bugs for 24.1
branch-release-24.2
Used to mark GA and release blockers, technical advisories, and bugs for 24.2
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-support
Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs
P-3
Issues/test failures with no fix SLA
T-observability
For certain types of complex queries, finding index recommendations can take significantly longer than the time to optimize or even execute the query. This is a problem because when the cluster setting
sql.metrics.statement_details.index_recommendation_collection.enabled
is true (which it is by default), we periodically collect index recommendations as part of execution to populate the DB Console SQL Insights. As a result, every few executions of a query could have high latency due to the time needed to collect index recommendations. This seems to have gotten worse in 23.2+ with #103782, which sometimes increases the number of index candidates considered.We should prevent index recommendations from significantly increasing the latency of production queries. Some ideas:
Jira issue: CRDB-42591
The text was updated successfully, but these errors were encountered: