[rt-devel] Listing.html, # of tickets\

Jesse Vincent jesse at bestpractical.com
Tue Apr 16 14:52:37 EDT 2002


If the ->Count is done _after_ the ->_DoSearch method is called by internal 
code, however (say by pulling out the first row), it will report
exactly how many rows are in the current result set.  The reason
for the disparity is that doing a whole bunch of selects just to get counts
turns the rest of the system into molasses :/  
I'm currently investigating some changes in the architecture for 2.2 that will
significantly improve the performance of all this stuff and get ->Count to be
more accurate as a happy side-benefit.

	-j

On Tue, Apr 16, 2002 at 08:41:55PM +0200, Bruce Campbell wrote:
> On Tue, 16 Apr 2002, Matt Disney wrote:
> 
> > I've tried to add a line to the header of
> > $RTPath/WebRT/html/Search/Listing.html so that it displays the number
> > of tickets resulting from the query:
> >
> > <& /Elements/Header, Title => "Search Results: ".$session{'tickets'}->Count()." Tickets", Refresh => $session{'tickets_refresh_interval'} &>
> 
>  ->Count essentially changes the SQL query from:
> 
> 	select field.field.field from (etc)
> to
> 	select count(id) from (etc)
> 
> If a Limit statement is applied (which is how the 50 per page stuff does),
> count is faithfully reporting how many rows would be returned ;)
> 
> > I'm not entirely sure this is a bug exactly, I'm just wanting to know
> > if anyone has suggestions on how I might go about accumulating the
> > total number of tickets for a search.
> 
> Depending on your installation, I'd be rather careful (repeating rather
> broad searches just to get a count on each new page is ugly), however
> storing the total results in the %session, and checking that you haven't
> already gotten a total result for the current search would be nifty.
> 
> -- 
>                              Bruce Campbell                            RIPE
>                    Systems/Network Engineer                             NCC
>                  www.ripe.net - PGP562C8B1B                      Operations
> 
> 
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-devel
> 

-- 
http://www.bestpractical.com/products/rt  -- Trouble Ticketing. Free.




More information about the Rt-devel mailing list