Posts: 1,743
Threads: 36
Joined: Jul 2010
Reputation:
0
hello,
I'm not sure how to structure the database, i'm making new systems for my server and the table have a big number of columns, (doing query slow).
what's better to do:
one table with various columns or more tables with less columns ?
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Depends on what you want to do. But you would want to avoid having data doubled anywhere (except for the keys, of course).
Posts: 1,743
Threads: 36
Joined: Jul 2010
Reputation:
0
currently i have 70 columns in table "accounts" with:
'connected', 'money', 'level', 'bank-money'... and I have to add even more, probably 50
when the player do login, i load all accounts table "select * from accounts where nickname=maria", 30 percent of columns are not used at this time.
the point is, sometimes I have to list all accounts "select x, y, z from contas where value=1"
probably the result is 170+ accounts
exemple:
select A,B,C,D,E,F,G,H from table Vince (with 100 columns)
or
select A,B,C,D from table Vince (with 50 columns)
select E,F,G,H from table Falcon (with 50 columns)
what i really wanna know is, which of the two gets more performance =/
Posts: 1,177
Threads: 27
Joined: Sep 2011
Reputation:
0
Pretty sure keeping them in 1 table would be better. If not, it wouldn't make a difference.
Posts: 1,743
Threads: 36
Joined: Jul 2010
Reputation:
0
I'm afraid of doing wrong, and then having to re-structure all database and pawn code =/