Posts: 368
Threads: 24
Joined: Feb 2012
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)
Posts: 368
Threads: 24
Joined: Feb 2012
Posts: 1,253
Threads: 36
Joined: Aug 2011
Reputation:
0
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).
Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
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.
Posts: 368
Threads: 24
Joined: Feb 2012
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.