pingcap / pingcap/tidb

Need a more clear behavior about how to load needed statistics

Open
#57,521 4 comments 0 reactions 1 assignee Claimed by @mjonss View on GitHub
component/statistics sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

Some facts of the current TiDB:
- We've introduced `ANALYZE TABLE PREDICATE COLUMNS` and `ANALYZE TABLE COLUMNS` to collect parts of table columns to improve the speed of analyze and optimize the collected statistics' memory usage.
- When we use this two ways to collect statistics, the stats of one column that is not a predicate or not specified in `COLUMN_LIST` will not be deleted.
- If one SQL marks that column as stats needed, we'll load its outdated stats into memory.
- In many cases, the loading procedure will not be a problem. But if those columns are quite large. It will affects the performance of sync load.
- And there'll be the same problem for change value of the variable `tidb_analyze_skip_column_types`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.