Is there a reduction in overhead when using multiple statements in one query for mysql?

I was wondering if I could reduce the overhead by sending multiple statements on the same query to the database. Is it possible?

I am currently sending requests one by one and would like to send a packet multiple at the same time (everything I send is 2k or so)

They all choose requests

+3


source to share


2 answers


I have used batch inserts with Grails and MySQL, and the insertion time is 100x faster! (I processed about 50 inserts at once with batch processing). So I can definitely say that batch inserts save a lot of time.

I'm not sure how much of this post can help you, but here 's the Performance Reference: SUBQUERY vs JOIN



The way you join tables can also be a major performance issue.

+1


source


SQL batch operations can definitely improve overall speed. For small queries, the slowest part is often the DB connection. This is an expensive step, regardless of the SQL query itself. You can reduce this overhead by reducing the number of times you have to create and destroy these DB connections.



0


source







All Articles