I'm using Microsoft's Entity Framework. It automatically creates indices for every foreign key, but in many cases, I can see from the index stats that these are never used for reading - they are only ever updated (which doesn't surprise me as I doubt I am ever actually doing a join on many of them). My gut feeling is that I should remove these indexes as they are just slowing down updates (albeit probably not that significantly) and taking up space. I like to try to keep things clean and lean. Is there a good reason to keep them?

  • EF version you use? – ErikEJ Jul 31 '16 at 18:05

Foreign keys should be indexed as a best practice. If you're not using them now, you can disable them or drop them, but you may want to use them later. The impact on performance is negligible in most cases if you keep them.

I'd leave them as is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.