I hoped your table structure is a little bit simpler so you could temporarily store the data you'd insert into an finite array which will be used to construct the multi insert query when full or some time has passed.
I have no better idea at the moment so i tested how big the difference would be with 10 simple queries to the sqlite database. The code using a transaction looked like this.
PHP Code:
char query[1024];
Transaction txn = SQL_CreateTransaction();
for (int i=0; i <= 10; i++)
{
Format(query, sizeof(query), "INSERT INTO `test` (`id`) VALUES (%d)", GetRandomInt(1, 999999));
txn.AddQuery(query);
}
SQL_ExecuteTransaction(g_hDbHandle, txn, TXN_OnSuccess, TXN_OnFailure);
It took 0.014 ms on average on my machine for 10 queries, 100 took around 0.057 ms.
Then i used normal queries where the code looked like this.
PHP Code:
char query[1024];
for (int i=0; i <= 10; i++)
{
Format(query, sizeof(query), "INSERT INTO `test` (`id`) VALUES (%d)", GetRandomInt(1, 999999));
g_hDbHandle.Query(SQLT_ErrorCheckCallback, query);
}
This took 0.015 ms on average on my machine for 10 queries, 100 took around 0.075 ms.
Is that what you were interested in?
__________________