Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: how to speed up querys to mysql

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

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 = ? 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://579327]
[LanX]: I don't get it
[LanX]: do I need to activate JS to see Trump loosing his wig?
[LanX]: aha ...
LanX Finally, there is a certain order or choreography to the greetings, which Kornhauser-Duda appears to have been following. First, the two heads of state shake hands, while the two first ladies do the same
[LanX]: FAKE NEWS , erix, so sad! Fired!

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-03-22 20:11 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (285 votes). Check out past polls.