opt: index recommendations should be aware of hash sharding #84681
Labels
A-hash-sharding
Hash-sharded indexes
A-sql-explain
Issues related to EXPLAIN and EXPLAIN ANALYZE improvements
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
docs-done
docs-known-limitation
E-quick-win
Likely to be a quick win for someone experienced.
T-sql-queries
SQL Queries Team
Is your feature request related to a problem? Please describe.
Today we give sub-optimal index recommendations for tables that contain hash-sharded indexes. For example:
The recommendation in this case is to recreate the non-hash-sharded pk as an index:
Describe the solution you'd like
We should not recommend creating an index on a column if an equivalent hash-sharded index already exists. If a hash-sharded index already exists but does not store all of the needed columns, we could suggest dropping it and re-creating the hash-sharded index with additional
STORING
columns.Epic: CRDB-14532
Jira issue: CRDB-17795
The text was updated successfully, but these errors were encountered: