Take the 2-minute tour ×
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. It's 100% free, no registration required.

Does interleaving several statement handles slow the system down?

Example (Perl):

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

vs

$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 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 at 23:51

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.