3.0.8 and redundant queries

Hi, 3 things:

  1. Like a couple of other people, with 3.0.8 I now see 'RT_System’
    being the owner of some new tickets instead of nobody.

  2. 3.0.8 seems a bit slower to me, but I changed a lot at the same
    time. I went from perl 5.8.0 to 5.8.3, DBIx::SearchBuilder .95 -> .96,
    RT 3.0.7 to 3.0.8, and Apache 1.3.28 to 1.3.29, mod_perl from 1.28 to
    1.29, and obviously many perl module upgrades.

  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 …)

murphy@kevin$ perl ~/cvs/egenome/src/scripts/analyze_pg_log.pl
–sort_by_dupes --params egweb_query.log

There are 21 unique basic queries:
Label Count Uniques TotalTime Avg-Time Query


14 non-redundant queries, then

O 3 2 0.001112 0.000371 SELECT * FROM
Users WHERE Name ILIKE ?String-1?
(‘Nobody’) x 1
(‘RT_System’) x 2
P 2 1 0.005790 0.002895 SELECT * FROM
Groups WHERE Type ILIKE ?String-1? AND Domain ILIKE ?String-2?
(‘Privileged’,
‘SystemInternal’) x 2
Q 2 1 0.000553 0.000276 SET TIME ZONE
?String-1?
(‘GMT’) x 2
R 2 1 0.001109 0.000554 SELECT * FROM
Queues WHERE Name ILIKE ?String-1?
(‘eg-web’) x 2
S 2 1 0.000285 0.000142 SET DATESTYLE
TO ?String-1?
(‘ISO’) x 2
T 2 1 0.001375 0.000687 SELECT
a_session FROM sessions WHERE id = ?String-1? FOR UPDATE

(‘00343fd30896db45cd6029219a19da1c’) x 2
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
Approx. elapsed time of this section of log is 5 seconds.
murphy@kevin$

(Then there’s the issue of what is going on for the other 4.9 seconds
:wink:

-Kevin

  1. 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@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@kevin$

(Then there’s the issue of what is going on for the other 4.9 seconds
:wink:

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@lists.bestpractical.com
The rt-devel Archives

Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.

Rockin. Thanks.

You want to instrument DBIx::SearchBuilder:Record::Cachable’s
Load* routines to see where they’re being called, what args they’re
being called with, what cache keys they’re generating and what’s in the
cache at the time. That was how I found the bug that we fixed in .96

Best,
JesseOn Thu, Jan 29, 2004 at 04:19:23PM -0500, Kevin Murphy wrote:

I will look into it tonight

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

Request Tracker... So much more than a help desk — Best Practical Solutions – Trouble Ticketing. Free.