[Dbix-class] Avoiding _prune_unused_joins

Bob MacCallum uncoolbob at gmail.com
Fri May 10 16:14:50 GMT 2013


Thanks Peter, that's awesome.
That gives me something like 15% speedup and I've written the test
already as advised.
(now I know about can_ok())
have a nice weekend!
cheers,
Bob


On Fri, May 10, 2013 at 5:04 PM, Peter Rabbitson <rabbit+dbic at rabbit.us> wrote:
> On Fri, May 10, 2013 at 04:46:45PM +0100, Bob MacCallum wrote:
>> (I'm using 0.08250)
>>
>> I'll avoid a boring preamble and just ask if anyone could advise on
>> how to construct resultsets so that deep in the internals,
>> _prune_unused_joins isn't called?  (so as to save me some CPU cycles)
>>
>> I have tried to read the code but I'm not really sure what $ident is holding.
>>
>> Here's the query that is called most in my code:
>>
>>   my $rs = $row->some_relation->search(
>>      {},
>>      { where => { rank => { '>' => 0 } },
>>        order_by => 'rank',
>>        prefetch => { type => { 'dbxref' => 'db' } } }
>>   );
>>
>> Performance with the prefetch is slightly better than with no prefetch at all.
>> Appreciate any help!
>
> $schema->storage->_use_join_optimizer(0);
>
> Note - this *will* be deprecated and removed in the future, when the
> internals get rewritten to avoid the perl-side penalty. Make sure you
> write a specific test to catch the disappearance of this method. It is
> not a question of "if" but of "when".
>
> Cheers
>
> _______________________________________________
> 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



More information about the DBIx-Class mailing list