pingcap / pingcap/tidb

ddl, planner: introduce a DDL notifier to allow the statistics module to subscribe DDL events

Open
#55,722 0 comments 0 reactions 0 assignees View on GitHub
component/ddl type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Background
In statistic module, we need all table information to rebuild the priority queue to do auto analyze every time, but in information schema v2, TiDB no longer stores all table information in memory(load as required), so we need a method to avoid traverse all tables as soon as possible, so we can try to keep the priority queue in memory to solve this problem.

In order to cooperate with the new priority queue we need a method to notify the statistics module handle DDL events.

## Development tasks

1. Introduce a new ddl change structure `SchemaChangeEvent` to replace the old `DDLEvent`, use getters and setters to avoid direct access to the struct's fields.
- [x] #55723
3. Add ddl notifier table and support ddl changes writing (write).

5. Implementation of the ddl notifier struct with subscription support (read).

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.