GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

Can I drop a foreign key constraint without any downtime

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can I drop a foreign key constraint without any downtime

    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.



  • #2
    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

    [URL="http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html"]http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html[/URL="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.

    Comment

    Working...
    X