sql: improve inverted index validation observability and runtime #54481
Labels
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
Is your feature request related to a problem? Please describe.
Inverted index creation is reasonably efficient. It uses the usual bulk-io index addition goodness. At the end of creating the index we run a validation step. Unlike unique indexes, this step is purely a sanity check. Unfortunately this check is far less optimized than the index construction itself. The check works by running two parallel operations, counting the entries in the new index and reading the primary index to count the implied entries to confirm they match. This can make inverted index validation very slow. This is made dramatically worse by the general lack of observability.
Describe the solution you'd like
I think my preference would be to remove the validation from the creation path and move it into something akin to
SCRUB
(but better because that thing is not good). Then, wherever we move it, we should provide good observability and better performance.Additional context
Related to #26639
Jira issue: CRDB-3756
The text was updated successfully, but these errors were encountered: