br
br copied to clipboard
Bypass the DDL layer for creating tables faster
Feature Request
Describe your feature request related problem:
When restoring many tables, it cost too many time for creating table, rebase auto ID or things likewise.
Describe the feature you'd like:
Use the meta.Meta API from TiDB directly to create tables.
Describe alternatives you've considered:
The current version -- using DDL to create tables, or execute the DDLs over the owner node.
Teachability, Documentation, Adoption, Migration Strategy:
There are about three steps when we want to creating a table from a model.TableInfo:
- alloc a new table ID for new table.
- create the table via
Meta.CreateTableOrView. - update the diff to the information schema, and waiting for other TiDB instance update this too.
(TODO: consistency, performance testing, etc..)
seems very helpful for DM's schema tracker 👍 will port it after your PR merged.