You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
statistics: skip stale stats metadata during initialization #69115
Statistics initialization should skip stale records in mysql.stats_meta when the corresponding physical table no longer exists in the current InfoSchema.
When a table is dropped, its statistics metadata can remain until stats GC removes it. During stats initialization, TiDB currently rebuilds the in-memory stats cache from mysql.stats_meta. If a stale physical table ID is loaded into the cache, later stats operations can observe statistics for an object that is no longer present in the schema.
The initialization path should validate each physical table ID against the current InfoSchema before adding it to the cache:
keep normal table IDs that still exist;
keep partition physical IDs that still exist;
skip dropped table or partition IDs whose stats metadata has not been garbage collected yet.
This keeps the stats cache aligned with the visible schema while preserving valid partition statistics.
Activity
statistics: skip stale stats meta during initialization (#69116)