On Tue, Jun 8, 2010 at 9:09 AM, Chris Cole <[email protected]>wrote:

>
>   # make SQL search both technical replicates at the same time
>   $dataset =~ s/t\d/t%/;
>   my $rs = $self->resultset('NgsMappings')->search(
>      {
>         'me_sample' => {'like', $dataset},
>      },
>      {
>         columns => [qw/mp_strand mp_ref_id.rs_name mp_start mp_end
> mp_freq/],
>         join => [qw/mp_me_id mp_ref_id/],
>      }
>   );
>

Add this line here:

$self->storage->debug(1);

to see the SQL that is being executed.  You can compare that to your
hard-coded SQL to see why it's so slow.


>   while (my $hit = $rs->next()) {
>      my $freq = $hit->get_column('mp_freq');
>      $nHits += $freq;
>   }
>   return($nHits);
> }
>

Ronald
_______________________________________________
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/[email protected]

Reply via email to