[MDEV-23798] Add GLOBAL indexes for partitioned tables Created: 2020-09-23 Updated: 2023-11-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Partitioning |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | Manjot Singh (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
In other RDBMS, there is the concept of GLOBAL or LOCAL indexes on partitioned tables. MariaDB currently has LOCAL indexes, which are local to each partition in a table. A GLOBAL index on the other hand is a one-to-many relationship, allowing one index partition to map to many table partitions and avoid the scanning behavior when partition keys are not in a query. Implementations on other databases: http://www.dba-oracle.com/t_global_local_partitioned_index.htm |
| Comments |
| Comment by Sergei Golubchik [ 2020-09-24 ] |
|
Could you please add some justification here? Note that we already have UNIQUE constraint over all partitions. |
| Comment by Manjot Singh (Inactive) [ 2020-11-13 ] |
|
My primary concerns: |
| Comment by Rick James [ 2021-02-22 ] |
|
Sergei, I thought UNIQUE was not possible unless the "partition key" was included in the UNIQUEness constraint. I agree that a global index is helpful for pruning. For example, a "range" over a HASH partitioning must now check all partitions; a global index would make pruning easy and efficient. I believe that HASH never provides performance benefits. I don't think that adding global indexing will change my mind. Can anyone provide a performance benefit relative to removing PARTITION BY HASH from the table (and adjusting the indexes if necessary)? |