View previous topic :: View next topic |
Author |
Message |
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Fri Jun 08, 2007 20:44 Post subject: Players have personal tables? |
|
|
I was considering giving every player their own personal table in my database. That way I can know exactly what is stored on them and so on. Plus it's a lot more organized.
Are there any downsides to this? Will the database eventually get so big that it'll cause lag?
Thanks. |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Fri Jun 08, 2007 21:28 Post subject: |
|
|
I think the main advantage of this is that you can delete the table with the character. Downsides, might increase read speeds a little, but I doubt by much, and I REALLY doubt it'd be noticable. Also makes getting data across characters much more intensive. For this reason we only use a few databases. Here's our table list:
fkymessageboard -stores messages on messageboards
loggedin - tracks players online, used for antieploits and cross-server playerlists
market - tracks the player market items
messages - tracks cross-server messaging system
objdata - tracks the player vaults and transfer chests
pwdata - holds nonquest player data, used for tracking things like quasiclass status, account-cd key linking, etc
qs_quests - holds quest completion data for players
qs_status - tracks cross-server quest statuses on servers for listing
9 different crafting tables (not used yet)
Our setup has evolved with the server, no doubt yours will as well. Deciding to do a table per player is laying the framework for a very differetn setup, but the beauty of sql is you can transfer data fairly easily between tables, so go with what works for you now.
Funky |
|
Back to top |
|
|
xaltos
Joined: 03 Jun 2006 Posts: 31 Location: Germany
|
Posted: Sat Jun 09, 2007 9:58 Post subject: |
|
|
I don't think so many tables with work out well.
Once 1000 or more have visited your world will you soon lose the overview very fast.
Just add a save way to id your players.
e.g. a passport item with a unique ID for all players and you find this id duringh loghin and store it for a faster access as well on the PC object.
So you only need one extra column for your DB tables for the ID and don't end up with so many tables. _________________ xaltos
NWN2_Audolo |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Jun 10, 2007 10:57 Post subject: |
|
|
What the others said. Plus, there is another problem with having one table per player: If you ever want to add a column to your data structures, you would have to update thousands of tables... not very funny, even if you can script it. _________________ Papillon |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Sun Jun 10, 2007 22:35 Post subject: |
|
|
Good points. Thanks everyone. |
|
Back to top |
|
|
|