SaranacLake Posted February 12, 2021 Share Posted February 12, 2021 I have a junction table (child) linking two parent tables. In the junction table I have a UK on 4 columns. The first column is the FK back to parent table-1. The second column is the FK back to parent table-2. In MySQL, can I just have a UK on the first 4 columns and have that satisfy the need for the UK plus the need to have indexes on columns that are FKs? Or do I need to double up, and add a straight idx on column 1 and then on column 2 along with my 4-column UK - which is an index also. Quote Link to comment https://forums.phpfreaks.com/topic/312134-does-uk-also-serve-as-a-fk/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.