[rt-devel] 3.0.8 and redundant queries

Jesse Vincent jesse at bestpractical.com
Thu Jan 29 15:52:49 EST 2004



> 3) This has been mentioned before, but why does RT issue the query 
> "SELECT * FROM Principals WHERE PrincipalType ILIKE  'Users' AND 
> ObjectId =  'X'" so often?  (I'm using PG).  In a search for all new or 
> open tickets in a queue, the following query forms have instances that 
> get executed more than once, i.e. the results are not cached on the RT 
> side (but I guess sometimes they cannot be ...)

The change from SearchBuilder 0.95 to 0.96 was primarily a fix to make
sure that redundant queries were pulled from RT's cache to the best of
our abilities.

> 
> murphy at kevin$ perl ~/cvs/egenome/src/scripts/analyze_pg_log.pl 
> --sort_by_dupes --params egweb_query.log
> 
> Label   Count   Uniques TotalTime       Avg-Time        Query
> -----   -----   ------- ---------       --------        -----
> U       314     1       0.000882        0.000003        SELECT * FROM 
> Principals WHERE PrincipalType ILIKE  ?String-1? AND ObjectId =  
> ?String-2?
>                                         ('User', '22') x 314
> ----    -----   -----   ---------
> Totals: 439             0.082435

That's...surprising. I'd be thrilled if you'd look into why
SearchBuilder::Record::Cachable isn't caching that lookup.


> Approx. elapsed time of this section of log is 5 seconds.
> murphy at kevin$
> 
> (Then there's the issue of what is going on for the other 4.9 seconds 
> .... ;-)
>

A good deal of it is probably spent dealing with the 314 loads of that
object from the database over the wire...


> -Kevin
> 
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/mailman/listinfo/rt-devel
> 

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



More information about the Rt-devel mailing list