-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: emit inverted index recommendations for types that can be both forward and inverted indexed #91777
Description
Currently, the index recommendation engine is unable to provide inverted index recommendations on columns whose types are also forward indexable.
This includes the TEXT type which can be inverted indexed with trigrams, and will include array types once #91762 is merged.
Solving this issue will require some refactoring - the index recommender represents hypothetical indexes as a slice of columns, without any extra space to store metadata like inverted vs not. The choice to provide an inverted vs forward index is made by examining the column types. Instead, we'll need to represent hypothetical indexes with a struct that contains the inverted vs not bit as well as the columns in the index.
We'll also need to make sure that we don't de-duplicate hypothetical indexes if they're identical save for their inverted bit, and make sure to generate both inverted and forward hypothetical indexes if both are supported on a type, instead of just one.
Jira issue: CRDB-21421
Metadata
Metadata
Assignees
Labels
Type
Projects
Status