I've been reading a lot about Relational Databases using many JOIN statements on every SELECT. However, I've been wondering if there's any performance problem on the long run when abusing this method.
For example, lets say we have a users
table. I would usually add the "most used" data, instead of doing any extra JOINs. When I say the "most used" data, for instance, would be the username, display picture and location.
This data would always be needed when displaying any user interaction on the website, example: on every comments
table JOIN for articles
. Instead of doing a JOIN on the users
& users_profiles
tables to get the 'location' and 'display', just use the information on users
table.
That's my approach, however I do know that there are a lot of excellent and experienced programmers that can give me a word of advice about this matter.
My questions are:
Should I try to be conservative with the JOINs? or should I use them more? Why?
Are there any performance problems on the long run when using JOIN a lot?
Note: I must clarify, that I'm not trying to avoid JOINS at all. I use them only when needed. On this example would be comment/article authors, extra profile information that only displays on user profiles pages... etc.