I need help to choose a modeling solution.
I have a Table A with a record that relates to many others in table B. For example: Text (A) and Users who favorited it (B) or Product (A) x Reviews (B).
So... I like to know how many people favorited a text or reviewed a product. Ok, this is easy WHEN it's only one query for this situation, but can get complex when I start to join more and more tables. For example, to find usernames that faved or average of reviews + photos included in reviews + products without reviews at all, and also when there is a review related, but still blocked for moderation, and so on.
Still, it's possible to do a query for that, I know, but...
Is it a better solution If the Table A has a column just for counting how many records are related in table B ? Like Favorite_Count, review_count, review_avg, ...
This would "save a join" in a complex query in exchange for just a little bit more coding when someone favorite or unfavorite something. In the end the query would be easier to read and probably faster, right ?
What do you think ?