Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does interleaving several statement handles slow the system down?

Example (Perl):

$sth1->execute(...); $sth2->execute(...); $sth1->execute(...); $sth2->execute(...); (interleaved)


$sth1->execute(...); $sth1->execute(...); $sth2->execute(...); $sth2->execute(...); (not interleaved)

(A real example would involve several hundred calls in a loop.)

share|improve this question
The question is too vague to be able to be answered in a scientific way, performance may depend a lot on the actual queries and the state of the database cache. I really recommend you to test it (shouldn't take long) or ask more specific question with actual code and SQL. – jynus Jul 5 '14 at 3:57
$sth->execute() is a blocking call, so on the surface, the answer should be that it makes no meadingful difference, as your code is still only executing one thing at a time on the server, and an idle statement handle... is idle. The question seems to lack sufficient specificity for a meaningful answer. – Michael - sqlbot Jul 6 '14 at 23:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.