Just wondering if my planned layout of mysql database is optimal:
I have three tables:
A main table, which has a lot of data in a row. It has a usernumber field as its Primary. It has a username field set to Index. And a bunch of regular data fields.
In a score table (its a game) there is a username field set to Primary and a score field set to Index. This table is there so people can search the score list without needing to go through the main table.
In a challenge table (to challenge other users) there is a username field set to Primary and two Indexes for the two different ways to challenge people.
Is this optimized considering it will either have to search usernames (via the main table), scores, and two challenge types? Also, is it optimized if the program needs to look at one of the two side tables entries via the username?
Thanks in advance, this is my first usage of databases in a programming situation.