[rt-users] Limit on queues display

Emmanuel Lacour elacour at easter-eggs.com
Fri May 28 11:08:20 EDT 2004


On Fri, May 28, 2004 at 07:01:16PM +0400, Ruslan U. Zakirov wrote:
> You can do it in one select:
>       $Tickets->ClearRestrictions;
>       $Tickets->LimitStatus(VALUE => "open");
>       $Tickets->LimitStatus(VALUE => "new");
>       $Tickets->LimitStatus(VALUE => "stalled");
>       $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '=');
>       next unless( $Tickets->Count() );

It's a better code, thx for this quick right answer:)
It s only a little bit faster, but I thinks it's impossible to make it
better:/ That's the probleme with lot of queues.

> You think wrong. Limit* is perl subs which push conditions on stack and 
> only when you call Count or some fetch op(First, Next...) RT/DBIx::SB 
> generate SQL query that fetch info from DB.
> 
And you helps me right, thx again ;-)

> >
> >Is there a way to do this directly with somethink like a $Queue ->Limit??? 
> >statement.
> >(I think it could be better because SearchBuilder will do a more efficient 
> >job)
> No way, since Queue table doesn't contain info about amount of tickets. 
> Most efficient way is GROUP BY with COUNT(), but DBIx::SB doesn't 
> support it yet.
> 
Ok

-- 
Emmanuel Lacour ------------------------------------ Easter-eggs
44-46 rue de l'Ouest  -  75014 Paris   -   France -  Métro Gaité
Phone: +33 (0) 1 43 35 00 37    -     Fax: +33 (0) 1 41 35 00 76
mailto:elacour at easter-eggs.com   -    http://www.easter-eggs.com



More information about the rt-users mailing list