# Create foreign key with minimal locking

**URL:** <https://forums.percona.com/t/create-foreign-key-with-minimal-locking/6870>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [February 26, 2019, 12:13pm UTC](https://forums.percona.com/t/create-foreign-key-with-minimal-locking/6870 "2019-02-26T12:13:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Egan](https://avatars.discourse-cdn.com/v4/letter/e/bc8723/32.png) [@Egan](https://forums.percona.com/u/Egan)\
**Post date:** [February 26, 2019, 12:13pm UTC](https://forums.percona.com/t/create-foreign-key-with-minimal-locking/6870/1 "2019-02-26T12:13:49Z")

</div>

I’m new to this forum. My company uses Percona in a MySQL 5.7 environment. Is there a way to create a foreign key without locking the underlying tables for a long time? Alternatively, is there a way to disable an fk, drop an index, recreate an index, then re-enable the fk without ever dropping it, without locking the underlying tables for a long time? Of course, the index is on the same column as the fk column.
