pingcap / pingcap/tidb

make the `MemoryUsage` in statistics.Table/Column/Index o(1) instead of o(n)

Open
#53,666 0 comments 0 reactions 0 assignees 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
We've found https://github.com/pingcap/tidb/issues/52339 before.

The main problem is that
![image](https://github.com/pingcap/tidb/assets/7846227/57b565b3-fa4e-44b1-b4f0-c1d3cce67378)
![image](https://github.com/pingcap/tidb/assets/7846227/2537d8a8-01ba-4c60-8447-ec8375eb93e5)

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

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.