The consensus seems to be that all foreign keys need to have indexes. How much overhead am I going to incur on inserts if I follow the letter of the law?
NOTES:
- Assume that the database is a good design, and that all of the joins are legitimate.
- All Primary and Foreign Keys are of type Int.
- Some tables are lookup tables, with fewer than ten records, that are not likely to grow in size.
- It is an OLTP database.
- Some of the joins are to lookup tables with fewer than 10 records.
Thank you all for your input.
Based on your feedback, I think I will add indexes to all of the foreign keys EXCEPT those pointing to lookup tables (containing a small number of records that are not likely to change). This will cut the number of required foreign key indexes in half (from ten to five).
If anyone has further insight, feel free to post new answers. I still have some votes left. 🙂