I read a lot about relational databases using many JOIN statements for each SELECT. However, I was wondering if there is any long term performance problem with abusing this method.
For example, let's say we have a users table. Usually I add the "most used" data, instead of doing any extra JOINs. When I say that the "most used" data, for example, will be the username, image displayed and location.
This data will always be needed when displaying any user interaction on a website, for example: on each comments JOIN table for articles . Instead of doing JOINs in the users and users_profiles to get "location" and "display", just use the information in the users table.
That is my approach, however I know that there are many excellent and experienced programmers who can give me a word of advice on this matter.
My questions:
Should I try to be conservative with JOINs? or should i use them more? Why?
Are there long-term performance issues when reusing JOINs?
Note. I must clarify that I am not trying to avoid JOINS at all. I use them only when necessary. In this example, there may be authors of comments / articles, additional profile information that is displayed only on user profile pages ... etc.
source share