0

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?

1
  • EF version you use?
    – ErikEJ
    Commented Jul 31, 2016 at 18:05

1 Answer 1

0

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 and acknowledge you have read our privacy policy.

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