horaedb
horaedb copied to clipboard
Reduce the cost of massive stale tables
Describe This Problem
In the current implementation of the storage engine, one table must occupy some resources even if the table may not be used anymore. And the number of such tables grows larger, the waste of the resources grows too, e.g. slow recover, finding the max memory usage in all the tables.
Proposal
I could come up two ways to solve this problem:
- One way is to support clear these stale tables by introducing TTL mechanism on the table meta data.
- Another way is to open all the tables lazily to avoid load the stale tables into the memory to manage.
Additional Context
#1278 is an example caused by this issue.
Opening all the tables lazily is a sound method.