Not the answer you need?
Register and ask your own question!
Many Forum changes were implemented on Tue 22 Sep. Read about new Ranks, Scoring, and Reactions.
Email [email protected] for any comments or concerns.

Can I drop a foreign key constraint without any downtime

jthibeauxjthibeaux EntrantCurrent User Role Beginner
I would like to assume 'yes', because it seems like it should be a rule that just stops being applied, but since I have not done this on a large database, I want to confirm.

Comments

  • niljoshiniljoshi MySQL Sage Inactive User Role Beginner
    Hi,

    Yes, you don't need any downtime to drop foreign key constraint but it will lock the tables during ALTER so it might affect to performance and you found some queries in processlist waiting for release of that lock. If you dont want to lock tables, you can use Percona utility

    http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html

    I would suggest to test it on stage server before production.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.