I am designing a database that will include a high score list and need the SQL queries to be fast for the list.
There will be a 1-to-1 relationship between an entry on the high score list and the users, but I don't need all the user info for the list itself.
So, I'm wondering whether design will be faster for querying the database.
2 tables with 1-to-1 relationship.
users table: ID (PK) - name - email - entryID (FK)
entries table: ID (PK) - score - message - userID (FK)
SELECT score, message FROM entries ORDER BY score desc
users table: ID - name - email - score - message
SELECT score, message FROM users ORDER BY score desc
What I'm wondering is: Does the number of columns in a table affect the speed of a query, when you're selecting a subset of the columns?