Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
The ADD FOREIGN KEY and ADD CHECK constraints currently require the table to be rebuilt with ALGORITHM=COPY.
We could support these operations instantly if the user specified a WITHOUT VALIDATION clause. We currently do support instant ADD FOREIGN KEY after SET foreign_key_checks=0, but there is no such mechanism for ADD CONSTRAINT CHECK.
When validation is not suppressed, we should only scan the table and validate the added constraints. There is no need to write any data to the table. For LOCK=NONE operation, we may need to ‘subscribe’ to concurrent modifications somehow.
Attachments
Issue Links
- blocks
-
MDEV-16291 Allow ALGORITHM=NOCOPY for most ALTER TABLE in InnoDB
- Open
-
MDEV-16354 Allow ALGORITHM=INPLACE for ADD COLUMN…PERSISTENT AS
- Open
-
MDEV-30669 Changing the Data Type of a Column from Text to JSON causes a unexpected Table Rebuild
- Open
- is blocked by
-
MDEV-31008 Instant ALTER allows to violate column check constraint
- Confirmed
- relates to
-
MDEV-30416 Can't redefine constraint in a single ALTER TABLE
- Confirmed
-
MDEV-32171 When updating cascaded foreign keys, closing foreign key constraints is ignored and invalid.
- Closed
-
MDEV-32270 ALTER TABLE: DROP CONSTRAINT is ignored when ADD CONSTRAINT is also present
- Confirmed
-
MDEV-16332 Allow ALGORITHM=NOCOPY or INSTANT for changes of virtual column type
- Confirmed
-
MDEV-19453 FK errors are hidden behind an obscure command
- Open
-
MDEV-28298 Add Foreign key to a table instantly without checking existing data
- Open
-
MDEV-30788 ONLINE Add Foreign Key
- Closed
-
MDEV-30934 InnoDB: Changing a Column Data Type from VARCHAR/TEXT to a super type causes a unexpected Table Rebuild
- Open
-
MDEV-33087 ALTER TABLE...ALGORITHM=COPY should build indexes more efficiently
- Closed
-
MDEV-34309 CHECK TABLE should check that foreign key relations are correct
- In Progress