SA-MP Forums Archive
Many 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 queries (/showthread.php?tid=632015)



Many queries - Bussyman - 08.04.2017

Hi,

I test, something i send about 10k queries, in game, and i make command to see how much is not completed, i see that in second is just about 40~50 queries is complete. Why is that slow? if queries are completed in 0.001, or even 0.01, still per second there will be faster, maybe there need to update something?


Re: Many queries - Vince - 08.04.2017

Depends on the type of query (select, insert, update), the query itself, the database engine (InnoDB or MyISAM) and the hardware that runs it. A run of 50 queries per second seems pretty standard though (20 millisecond average). The average single select query takes between 5 and 15 milliseconds to execute and then there's the overhead from Pawn.

For batch inserts or updates use transactions so that the database doesn't automatically commit after each statement.