-
Notifications
You must be signed in to change notification settings - Fork 4.1k
opt: add histogram type field to persisted histograms in table statistics #50655
Copy link
Copy link
Open
Labels
A-sql-optimizerSQL logical planning and optimizations.SQL logical planning and optimizations.A-sql-table-statsTable statistics (and their automatic refresh).Table statistics (and their automatic refresh).C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamSQL Queries Team
Description
Table stats recently gained inverted histogram data, but it is not marked as such, instead the system relies on some assumptions about column types to know if a histogram is from an inverted index or not. We need to add an indexParameter column to table stats to describe what kind of index the histogram is from. This will be necessary when:
- We support types that have inverted indexes in PKs, and need to generate histograms for both their forward and inverted indexes.
- We support different geo index configs, and need to know which a histogram is generated from, since a user might have different inverted indexes on the same column with different configurations.
- We support full text or other kinds of inverted indexes that have user-specifiable parameters.
Whatever this indexParameter column holds, it must be easily consumable by the stats code such that it is easy to find the best histogram to use. Since some of these index configs can contain arbitrary strings or numbers, it may make sense to use JSON instead of STRING so we don't have to build a parser to consume the data.
Jira issue: CRDB-4105
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-optimizerSQL logical planning and optimizations.SQL logical planning and optimizations.A-sql-table-statsTable statistics (and their automatic refresh).Table statistics (and their automatic refresh).C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamSQL Queries Team
Type
Projects
Status
Backlog