Yes, you can save using multiple statements. We send
hundreds...thousands of statements in a single batch in our machine
automation application. The communication cost is relatively fixed (with
in reason), where the actual work to be done (mostly inserts) was very
fast for us in our table schemas.

Ed

-----Original Message-----
From: Andy Hall [mailto:[EMAIL PROTECTED] 
Subject: Sending multiple queries to MySQL (sorry, hit send by
accident!)

Hi,

I have a situation where, within a PHP loop, I am creating over one
hundred SQL statement (INSERTS and UPDATES).

Would it cut any overhead to send 20 ";" seperated queries in one
mysql_query() statement, and therefore only execute mysql_query() 5
times for 100 statements, as opposed to sending each statement
individually?

So, 

mysql_query("INSERT 1", "UPDATE 1...", "INSERT 2...", "UPDATE 2..");

or:

mysql_query("INSERT 1");
mysql_query("UPDATE 1...");
mysql_query("INSERT 2...");
mysql_query("UPDATE 2..");

Do you save by not making as many connections?

Thanks

Andy.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to