Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
No such thing as a small change
 
PerlMonks  

Re: how to speed up querys to mysql

by reneeb (Chaplain)
on Oct 19, 2006 at 06:59 UTC ( [id://579327]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to how to speed up querys to mysql

You should prepare the statements before you iterate through the loops and use the ?-notation:

my $statement = 'SELECT a1.ID FROM a1, a1_b1, b1 WHERE b1.id = ? AND a +1 = ?'; my $sth = $dbh->prepare($statement) or die $dbh->errstr(); for my $a1(@array1){ for my $b1 (@array2){ $sth->execute($b1,$a1) or die $dbh->errstr(); # ... other stuff ... } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://579327]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.