MySQL 40 - (p/t)query.
#2

From me: ( https://github.com/pBlueG/SA-MP-MySQL/issues/83 )
Quote:

mysql_tquery is better because it won't block your server's thread (noticeable at huge/bad queries). It will send the query to the MySQL server and will receive the result, then the MySQL Plugin will automatically call the callback for you to manipulate the result, and after the callback was finished, the MySQL Plugin automatically deletes it for you (so your problem from 1 will be gone). The disadvantage of tquery is that, unlike pquery, it will execute only on one connection, so if another big dirty ugly query is slowly executed, it will block that new query from being executed, but still not your main server's thread ! You will receive the result when it has it. If you use pquery you can send more than one unoptimised query and you will receive the results when they are received from each query. (I don't recommend you to use it just because you don't know how to make some queries optimised, you still have to optimise them)

pquery = parallel query, the queries can be executed in parallel, think of it like multiple tquery connections, it won't have just one queue for it, but it will have more, the value you can specify in mysql_set_option with the POOL_SIZE parameter.

Doing something like
Код:
mysql_pquery( ..., "SELECT * FROM `accounts`", "Callback1" );
mysql_pquery( ..., "SELECT 1", "Callback2" );
won't guarantee that the first query's callback will be executed first, they can be executed in any order. tquery keeps the order to call the callback (because they wait in the same queue, so they get executed one after one, in the order you sent them in your script), while pqueries can be executed in any order, as they have different queues.
Reply


Messages In This Thread
MySQL 40 - (p/t)query. - by Meller - 17.11.2017, 20:13
Re: MySQL 40 - (p/t)query. - by IstuntmanI - 17.11.2017, 20:25
Re: MySQL 40 - (p/t)query. - by Meller - 17.11.2017, 20:29
Re: MySQL 40 - (p/t)query. - by IstuntmanI - 17.11.2017, 20:35
Re: MySQL 40 - (p/t)query. - by Meller - 17.11.2017, 20:37
Re: MySQL 40 - (p/t)query. - by wallee - 18.11.2017, 01:33
Re: MySQL 40 - (p/t)query. - by IstuntmanI - 18.11.2017, 14:16
Re: MySQL 40 - (p/t)query. - by wallee - 18.11.2017, 15:40

Forum Jump:


Users browsing this thread: 1 Guest(s)