Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Bypass the DDL layer for creating tables faster #1381

Open
YuJuncen opened this issue Jul 26, 2021 · 1 comment
Open

Bypass the DDL layer for creating tables faster #1381

YuJuncen opened this issue Jul 26, 2021 · 1 comment
Labels

Comments

@YuJuncen
Copy link
Collaborator

YuJuncen commented Jul 26, 2021

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:

  1. alloc a new table ID for new table.
  2. create the table via Meta.CreateTableOrView.
  3. update the diff to the information schema, and waiting for other TiDB instance update this too.

(TODO: consistency, performance testing, etc..)

@lance6716
Copy link
Contributor

seems very helpful for DM's schema tracker 👍 will port it after your PR merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants