make the `MemoryUsage` in statistics.Table/Column/Index o(1) instead of o(n)
Open
component/statistics
sig/planner
type/enhancement
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
We've found https://github.com/pingcap/tidb/issues/52339 before.
The main problem is that


The MemoryUsage API of the table is a really heavy one.
To improve it, we need to make the memory usage of the table updated when its `Columns` and `Indices` are updated. So we need to use Set/Get API and make those two fields unexported.
Contributor guide
Assessment
This issue has not been assessed yet.