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

Remove restriction on table partitioning about all partition columns needs to be included in all unique keys. #36019

Closed
mjonss opened this issue Jul 7, 2022 · 1 comment
Labels
component/tablepartition This issue is related to Table Partition of TiDB. type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@mjonss
Copy link
Contributor

mjonss commented Jul 7, 2022

Feature Request

Is your feature request related to a problem? Please describe:

When using table partitioning in TiDB one needs to include all partitioning columns in all unique keys, to ensure uniqueness. This sometimes leads to breaking the real properties of unique and primary keys simply because one wants to partition a table (like adding the partitioning columns to the PK).

Describe the feature you'd like:

Support unique indexes to not include the partitioning columns.

This can be done in different ways:

  • Only enforce uniqueness within each partition (I would prefer to not break the table uniqueness, but we may want to give this possibility to the user/DBA). (like EnterpriseDB)
  • Support Global Index (separate feature request)
  • Check all partitions for duplicates on insert/update (write), similar to how secondary indexes are searched, but cannot make use of partition pruning.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@mjonss mjonss added type/feature-request Categorizes issue or PR as related to a new feature. component/tablepartition This issue is related to Table Partition of TiDB. labels Jul 7, 2022
@Defined2014
Copy link
Contributor

We decided supports global index, and it GA in v8.5.0, so close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tablepartition This issue is related to Table Partition of TiDB. type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants