On 8 Jun 2010, at 15:17, Chris Cole wrote:
> 
> Which when run in an SQL client takes <1 sec to run and via 'normal' DBI the 
> full code still runs in ~1.5 min. So, there's nothing wrong with the SQL. 
> There seems to be something up with DBIC. This is DBIC v0.08122 BTW.

How many rows are there in the database?
Also what version of perl and on what platform?

Did you install DBIC yourself - if not grab a copy and make sure you
run the test
        t/zzzzzzz_perl_perf_bug.t

which checks for installations which have strangely slow object
creation characteristics....

Also try replacing this:-
  while (my $hit = $rs->next()) {
     my $freq = $hit->get_column('mp_freq');
     $nHits += $freq;
  }

with
  $nHits = $rs->get_column('mp_freq')->sum();

[Look at http://search.cpan.org/perldoc?DBIx::Class::ResultSetColumn
for an idea as to whats happening here - the get_column is a resultset
method not a row method]

        Nigel.
--
[ Nigel Metheringham             nigel.methering...@intechnology.com ]
[ - Comments in this message are my own and not ITO opinion/policy - ]





_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to