in reply to Perl/CGI + MySQL: How many calls is too many?

I can give you my own experience.. for a community site I built, that would have been too much. What are all those selects and updates for?

Some table types penalize you less if you are doing selects and inserts at the same time.

You might want to see if you can apply GROUP BY to reduce the number of selects you are doing.. The presorted output is much faster to access within Perl. I got 20x-30x efficiency improvement for a spreadsheet report generator.

If you can make more complex data objects and maybe serialize you might be able to get away with a just a couple of statements. Perhaps if you post your data structure and what you need to do you could get more help.

  • Comment on Re: Perl/CGI + MySQL: How many calls is too many?

Replies are listed 'Best First'.
Re: Re: Perl/CGI + MySQL: How many calls is too many?
by oakbox (Chaplain) on Jan 09, 2003 at 08:58 UTC
    In MySQL, in my current project, it was the Group by's that were killing me. It's much faster to just slurp all of that information into a hash ref and do the grouping in Perl. The same goes for SUM and COUNT calls. If you are doing more than one or two of these calls, you pretty much NEED to pull that data into Perl and do the additions there.

    oakbox