Optimize table meta to reduce memory consumption #17200
Closed
Description
Development Task
Sometimes there're many tables in a TiDB cluster. e.g.
- TiDB is used for data warehouse
- in multi-tenant environment, each user has a database
For this scenarios, memory for each table should be limited.
However, TiDB always loads all tables in all schema at once in bootstrap, which can consume very much memory.
On the other hand, statistics info also occupies much memory, and it has been proposed in #16572
In low-profile nodes with 8G or 16G memory, it always encounters OOM.
For the scenarios above, some tables are rarely used, so they can be loaded lazily and released after being idle for a long time.
See also #16572
Activity