Skip to content

Skip Initial Table Statistics When TiDB Starts with skip-init-stats for Maintenance #63103

@0xPoe

Description

@0xPoe

Feature Request

Is your feature request related to a problem? Please describe:
When starting an interim TiDB instance with the skip-grant-table configuration for maintenance (such as resetting the root password), the instance may crash due to initial statistics collection if there are many user tables, even when lite-init-stats is enabled. This is problematic because these maintenance instances typically run on minimal hardware and are not intended for regular user queries.

Describe the feature you'd like:
When TiDB is started with skip-grant-table, the system should skip collecting initial table statistics entirely. This will prevent unnecessary memory usage and potential crashes during maintenance operations.

Describe alternatives you've considered:

  • Relying solely on lite-init-stats=on, which may still be insufficient for instances with a large number of tables.
  • Manually adjusting hardware resources for the interim instance, which increases cost and operational complexity.

Teachability, Documentation, Adoption, Migration Strategy:
This change is transparent to regular users, as it only affects instances started with skip-grant-table for maintenance. Documentation should note that initial stats collection is disabled in this mode, and users should not expect normal query performance or statistics during maintenance. No migration steps are required; adoption is automatic when using the skip-grant-table option.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions