[dbi-dev isn't the right place for this, so I've removed it from the CC list.]
On Fri, Mar 28, 2003 at 12:43:50PM -0600, Michael Muratet wrote: > Greetings > > my $rth = $dbh->prepare("SELECT * FROM demographics_1 WHERE KEY1=$key"); > $rth->execute(); > while (my $ref2 = $rth->fetchrow_hashref()) { > > This takes forever: > > DBI::Profile: 93.279098 seconds (22 method calls) matchDemographics.pl > 'DBD::mysql::st::execute' => > 93.277343s > 'DBD::mysql::st::fetchrow_hashref' => > 0.001074s / 15 = 0.000072s avg (first 0.000082s, min 0.000048s, max > 0.000113s) > > The same query from the command line takes 0.02 seconds. A factor of > 5,000 tells me I've made a stupid blunder somewhere, but I've read and > reread the documentation and it all looks OK to me. > > Is there a FAQ somewhere, or does someone have an idea of common blunders that > lead to huge performance degradations? During the 93 seconds the execute takes, start the mysql client in another window and do a "show processlist" (or show full processlist) and try to identify your client connection and what status it is in. Tim.