I wish to understand how to structure my database for best performance.
So I have this meal planning app which I’m working on. I have a user data type as usual, and a ‘Plan’ datatype. A user can add a meal to a plan, which means that there is a list of entries(meals) in the plan data type which belong to a particular user.
Now I’m thinking that there’s no need for a user column in the plan datatype if ‘created by’, which is an automatically generated column exists. If i need to link the user’s meal to the user, I can just use the ‘created by’ column to do that. Am I wrong in thinking like that? will that be better for performance or do I need to exclusively add a user column to my plan datatype? Note that I will have to make that link between users and their meal plans dozens of times in my app.