Many mySQL queries - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Many mySQL queries (
/showthread.php?tid=423427)
Many mySQL queries -
MP2 - 17.03.2013
Is it a bad idea to send ~30 queries at once (threaded)?
Don't ask why I would do this (I'm likely not going to) I'm just wondering. I know sending 30 UN-threaded queries would be bad, but what if they're threaded? Would it have an impact on the database or what?
Re: Many mySQL queries -
Vince - 17.03.2013
Hardly. Consider that this forum sends about 14 queries every time a page loads, with more than 1000 users browsing the forum at this very moment.
Re: Many mySQL queries -
MP2 - 17.03.2013
What about a remote connection?
Re: Many mySQL queries -
mastermax7777 - 17.03.2013
why dont u try and see? benchmark
Re: Many mySQL queries -
Scenario - 17.03.2013
It should still be fine, assuming there's a strong connection between the server sending the queries and the mySQL server itself.
Re: Many mySQL queries -
MP2 - 17.03.2013
Okay, thanks.
Re: Many mySQL queries -
MP2 - 24.03.2013
Again, just wondering: Is it a bad idea to be sending ~50 queries per second, EVERY second? Again, I'm not really planning on doing this, I'm just curious.
Re: Many mySQL queries -
Misiur - 24.03.2013
If there is any way to reduce the number of them (some merging, multiple updates in single query, unions or joined queries) better do it. However if your sql server isn't at $5 shared hosting it should keep up.
Re: Many mySQL queries -
MP2 - 08.04.2013
Another question regarding this..
I have many different scripts (by the 'end' of development there will be 50+ that use queries) and I was wondering: Is it best to load the data for those systems in one big query, or send one query per system?
For example, say I have a script for hidden packages (oysters, horseshoes, gangtags and photo ops). Should I load the data for which ones a player has found in that script, or in the main GM with the main player 'SELECT' query?
Re: Many mySQL queries -
Scenario - 09.04.2013
I would personally load them individually.