sql: dynamically determine histogram sample size #123972
Labels
A-sql-table-stats
Table statistics (and their automatic refresh).
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-queries
SQL Queries Team
To collect histograms in table statistics, we currently sample 10k rows.
The number of rows sampled when building histograms for table statistics is 10k, and it can be configured with
sql.stats.histogram_samples.count
.For very large table, this is too few rows. We should find a way to dynamically adjust the sample size based on the size of the table.
See this discussion for more context: https://cockroachlabs.slack.com/archives/C01RX2G8LT1/p1701834921110179?thread_ts=1701825005.623189&cid=C01RX2G8LT1
Jira issue: CRDB-38633
The text was updated successfully, but these errors were encountered: