Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No mentioning of limitations of EXCHANGE PARTITION when it comes to Index IDs #19411

Open
mjonss opened this issue Nov 14, 2024 · 2 comments
Open
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata.

Comments

@mjonss
Copy link
Contributor

mjonss commented Nov 14, 2024

Change Request

Please answer the following questions before submitting your issue. Thanks!

  1. Describe what you find is inappropriate or missing in the existing docs.
    In partition can't exchange when table schema is same  tidb#50906 there is an issue for EXCHANGE PARTITION, when the table structures looks the same, but internally they have different index ids.

  2. Describe your suggestion or addition.
    Add a paragraph about EXCHANGE PARTITION and table structures, including the workaround CREATE TABLE tnp LIKE partitioned_table; alter table tnp remove partitioning; to get exact the same indexes etc.

  3. Provide some reference materials (such as documents and websites) if you could.
    https://docs.pingcap.com/tidb/stable/partitioned-table#partition-management

@Oreoxmt
Copy link
Collaborator

Oreoxmt commented Nov 15, 2024

@YangKeao Could you please help take a look at this issue and submit a PR to update the document if needed?

@Oreoxmt Oreoxmt added the area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. label Nov 15, 2024
@mjonss
Copy link
Contributor Author

mjonss commented Nov 15, 2024

Seems like this is a difference from MySQL, where the indexes just needs to be in the same order and identically defined, while for TiDB we need to have the same index id for each index as well, since the index entries are encoded with the index id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata.
Projects
None yet
Development

No branches or pull requests

2 participants