[MDEV-12483] Add foreign keys support for partitioned tables Created: 2017-04-10 Updated: 2024-01-18 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Partitioning, Storage Engine - InnoDB |
| Fix Version/s: | 11.5 |
| Type: | New Feature | Priority: | Major |
| Reporter: | Valerii Kravchuk | Assignee: | Aleksey Midenkov |
| Resolution: | Unresolved | Votes: | 18 |
| Labels: | foreign-keys, partitioning, snc, upstream, upstream-not-supported | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Please, add support for foreign keys for (at least some subset of) partitioned tables. Generic solution for engine-independent foreign keys like the one discussed in https://dev.mysql.com/worklog/task/?id=148 may also work. See upstream https://bugs.mysql.com/bug.php?id=46661 and numerous duplicates. |
| Comments |
| Comment by Marko Mäkelä [ 2017-04-10 ] | |
|
I think that properly supporting this would require that the FOREIGN KEY constraint metadata be stored at the SQL layer and not inside InnoDB. MDEV-11655 proposes the table mysql.tables_children for this purpose. | |
| Comment by Manjot Singh (Inactive) [ 2018-04-18 ] | |
|
Upstream has moved partitioning to the engine level. This could be fixed within InnoDB right? | |
| Comment by Aleksey Midenkov [ 2019-04-12 ] | |
|
manjot This can be fixed at InnoDB and probably should be done so as a preliminary step because the generic solution is much more time consuming. | |
| Comment by Manjot Singh (Inactive) [ 2019-04-12 ] | |
|
So perhaps this is something better addressed as a storage engine feature, especially since FK are also storage engine features. | |
| Comment by Justin Scott [ 2021-07-01 ] | |
|
We are starting a new project that will utilize Mariadb. The System Versioned tables feature you guys implemented is pretty awesome. When this issue is resolved will we be able to easily move our historical data to another partition? Some of the tables where we use this System Versioned feature have foreign key columns that we want to keep track of. | |
| Comment by Daniel LUCAS [ 2023-08-28 ] | |
|
Hello, I'm working on a client project for Webnet. In the project we set up MariaDB system versioning on the database which is becoming slow. I read in the docs that using different partitions for the history should improve the application performance. However, when setting up the current and history partitions I ran into the following error :
Are there any plans to make using foreign keys in partitions possible using INNODB ? |