MYSQL, saving players data.
#1

Is it better to often execute small queries? Like if player recieved alot of money and only save the money.
Or not so often, just save all players data in one query? (Query size on saving all data is 1650 cells)
Reply
#2

Bump
Reply
#3

I think this would be based on opinion.

If saving everything at once would cause some lag or something, I'd say do small queries.

Else-wise, I prefer to save things like money individually, when they are given, and things like jail time and positions when the player disconnects (all at once).
Reply
#4

I prefer sending small queries if I can. A lot of times, people will save EVERYTHING in their player enum and honestly, the majority of that doesn't ever need to be saved. Most of it like if a player is banned, in admin jail, muted, their admin level, etc. should be saved when they are edited/changed and not when the player logs off.

So, you shouldn't have to worry about large queries vs. small queries as most of your queries should be small.

By the way, if you thread your queries, you shouldn't need to worry.
Reply
#5

Thanks for the answer RealCop!

I made the changes to my gm like you said, and hourly saving of player data is alot less now.

I am using threaded queries (BlueG R20).
But what im worried about is this;
pawn Code:
Run time error 3: "Stack/heap collision (insufficient stack size)"
It happends sometimes, it dosent have any noticable effect in the server thought.
I am using crashdetect plugin, so is it possible to avoid this?

I compile with "-d2 -O1", and get this; Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion

On compile without -d2 it compiles without that message.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)