catId(INT) | userId(INT) | catName(VARCHAR) 0 1 Cat1 1 1 Cat2 2 2 U2Cat1 3 2 U2Cat2
I want to most efficiently access all the categories of a single userId (say SELECT * WHERE userId = 1)
So, imagine say, a 100 000 users, each with about 10 categories. What would be the most efficient way of modeling this.
"How to make the DB cluster this efficiently,and feel free to talk about how it would look in memory if you understand it at least on a basic level (I'm a programmer)."
Here is some help to understand the question more easily:
Which of these data structures would a DB store the above table in by default, would it choose automatically between one of these in the link bellow, or do I have ways or have to force it.
I guess I would be thankful if you happen to know of a tutorial that explains how rows and columns relate to data structures in the DB, that would help me picture it (and the correct solution, hopefully).