[Dbix-class] Why is this so slow?
Ronald J Kimball
rkimball at pangeamedia.com
Tue Jun 8 13:59:04 GMT 2010
On Tue, Jun 8, 2010 at 9:09 AM, Chris Cole <chris at compbio.dundee.ac.uk>wrot=
e:
>
> # make SQL search both technical replicates at the same time
> $dataset =3D~ s/t\d/t%/;
> my $rs =3D $self->resultset('NgsMappings')->search(
> {
> 'me_sample' =3D> {'like', $dataset},
> },
> {
> columns =3D> [qw/mp_strand mp_ref_id.rs_name mp_start mp_end
> mp_freq/],
> join =3D> [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 =3D $rs->next()) {
> my $freq =3D $hit->get_column('mp_freq');
> $nHits +=3D $freq;
> }
> return($nHits);
> }
>
Ronald
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100608/fd3=
e07ec/attachment.htm
More information about the DBIx-Class
mailing list