Sending commands in groups

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Sending commands in groups

Postby ThisIsNotMyName » 16. September 2019 21:49

I am accessing MariaDB 10.0.34 using its C API in a Linux system. I have the following question:

Imagine I have to send a number of MariaDB commands over the C API. In general, will there be much of a performance difference, as far as MariaDB is concerned, between invoking mysql_query() for each command, and accumulating a (potentially long) sequence of commands and invoking mysql_query() for this sequence? Does the overhead concomitant to invoking mysql_query() make it worth the while, in general and at least in principle, to gather together several MariaDB commands before invoking mysql_query()?

I'll be running tests of my own in this respect, but I wonder if people with far more experience in this field than I have could possibly share their experiences and insights in this topic.
ThisIsNotMyName
 
Posts: 3
Joined: 16. September 2019 21:31
XAMPP version: 1
Operating System: LInux

Re: Sending commands in groups

Postby Nobbie » 17. September 2019 11:31

ThisIsNotMyName wrote:Does the overhead concomitant to invoking mysql_query() make it worth the while, in general and at least in principle, to gather together several MariaDB commands before invoking mysql_query()?


No. In general, the time consumed by the SQL parser can be neglected against the time caused by the physical DataIO (and the data is always the same).
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Sending commands in groups

Postby ThisIsNotMyName » 17. September 2019 22:46

OK, much appreciated.
ThisIsNotMyName
 
Posts: 3
Joined: 16. September 2019 21:31
XAMPP version: 1
Operating System: LInux


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 7 guests