I’m a noob with mysql and php, and need some help 🙂
I have a table called “match_tabel” with “id” as the primary key (auto_increment). I put the id key in there because of performance. However, since the id will be incremented for each new match, the id will become pretty large after a while.
Matches are also deleted once they are finished.
Say there have been 100,000 matches, which are all completed (deleted from the database), the next match will then get the id “100,001” when it’s created, even if it’s the only row in the database.
My question is. Should I use id?
Thanks
EDIT
For each match, there is a unique key. When I get a match, I search for that unique key…
Yes, you always use an ID (or some other name for a primary key, typically auto-incremented). Otherwise you have no way to refer to a specific row, and no way to relate data from multiple tables.