in reply to Re: Re: How to Speed up MySQL w/ Perl
in thread How to Speed up MySQL w/ Perl

Have you ever actually tested those assumptions?
No, I thought I'd read it. Good catch tachyon, cheers!
Sound of davis scrabbling furiously after some production code waving his hands...

Update: Ah, the bit I've read was about Apache::DBI overloading the disconnect methods. Either way, I was wrong to say what I said, and the finish/disconnect calls ought to be included

davis
It's not easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.
  • Comment on Re: Re: Re: How to Speed up MySQL w/ Perl

Replies are listed 'Best First'.
Re: Re: Re: Re: How to Speed up MySQL w/ Perl
by jZed (Prior) on May 26, 2004 at 12:48 UTC
    the finish/disconnect calls ought to be included
    Half right. Finish is not the same as disconnect. You remain connected to your backend until you explicitly disconnect (barring network problems, mod_perl, etc) but finish() happens on its own when you retrieve all the data. Read the DBI docs, you only need to call finish() when you execute a query, then disconnect or DESTROY before fully fetching all rows. In the OP's case, he/she does fetch all rows so you were right the first time about finish, there's no reason to call it at the end of this script.
Re: Re: Re: Re: How to Speed up MySQL w/ Perl
by El Linko (Beadle) on May 26, 2004 at 14:39 UTC
    "InactiveDestroy" (boolean) The "InactiveDestroy" attribute can be used to disable the database engine related effect of DESTROYing a handle (which would normally close a pre-pared statement or disconnect from the database etc). The default value, false, means a handle will be fully destroyed when it passes out of scope.

    It says the above in the DBI docs. If DBD::mysql isn't disconnecting connections when the database handle goes out of scope it is probably a bug.