18.05.2015, 21:35
Hi guys,
I'm in need of some input about MySQL tables.
I currently have 26 columns in my "playerdata" table and alot more are coming.
This table holds these fields:
Alot more columns would be added later on such as amount of jobs finished in each class (trucker, busdriver, pilot, courier, traindriver, ...) and several other things as well.
I could end up with over 40 columns easily.
My question:
Would it be better if certain data is separated from the main playerdata tables?
Like one table for ban-info, another for company-info, another one for finished jobs, and another for settings (like the fuelreadout, silentlogin, speedinmph, ...).
And keep the default table for the basic data such as his IP, money, score, experience, name, id, registerdate, ...
Is there a certain limit where it isn't acceptable anymore to hold all data in one table?
It's not that I'm creating columns like Jobs1, Jobs2, Jobs3, ... or anything like that.
Using one table has some advantages (all data is properly organised into one single table and can be read easily using a simple query).
Using multiple tables would make the queries alot longer and more complex.
I'm in need of some input about MySQL tables.
I currently have 26 columns in my "playerdata" table and alot more are coming.
This table holds these fields:
Код:
ID - Unique ID to identify each player in the database Name - The name of the player Password - His SHA512 hashed password RegisterDate - The date and time he registered his account (2014-12-05 09:17:34 for example) IP - The IP of the player AdminLevel - The admin-level (values ranging from 0 to 6) SilentLogin - 1 or 0 to indicate an admin can login silently (won't display "Admin xxx has entered the server" if set to 1) UnbanTime - The timestamp where a ban is ended BanReason - The reason for a ban Money - The money of the player Score - The scorepoints of the player Fines - The total value of the player's fines (when caught speeding) Tickets - The amount of tickets the player has TicketCost - The total value of his tickets (fines get converted into tickets when a cop catches a player which has any fine open) SpeedInMph - If set to 1 displays the speedometer in mph, 0 for kph FuelReadout - The readout setting for fuel (0 = bars, 1 = percent, 2 = liters, 3 = gallons) PoliceStation - Holds the ID of the police station the player is located (used when a player is jailed) JailTime - The amount of seconds remaining when the player is jailed FreezeTime - The amount of seconds remaining for the frozen player CompanyID - The id of the company in which the player is registered CompanyAccessLevel - The accesslevel in the company which determines his rights for certain things (a level 1 member can't kick someone for example) CompanyContribution - The amount of experience this player contributed to his current company CompanyJoinDate - The date and time this player has joined the company (2015-03-24 00:22:34 for example) CompanyJoinTime - The timestamp when this player joined the company
I could end up with over 40 columns easily.
My question:
Would it be better if certain data is separated from the main playerdata tables?
Like one table for ban-info, another for company-info, another one for finished jobs, and another for settings (like the fuelreadout, silentlogin, speedinmph, ...).
And keep the default table for the basic data such as his IP, money, score, experience, name, id, registerdate, ...
Is there a certain limit where it isn't acceptable anymore to hold all data in one table?
It's not that I'm creating columns like Jobs1, Jobs2, Jobs3, ... or anything like that.
Using one table has some advantages (all data is properly organised into one single table and can be read easily using a simple query).
Using multiple tables would make the queries alot longer and more complex.