Unusually long queries when calling GET_LOCK with MySQL

Hello,

I’ve been watching my slow queries log and came across some really long
queries, which happen at the same time one of our RT users has troubles
accessing RT. This happens when the one user attempts any action in RT. It
is just happening for this one user, and the problem goes away if that
user starts a new session.

The only other things in my slow query log look like ACL checks similar to
the ones listed at the bottom of this email.

These seemed a little bit long and I was wondering if anyone could give
me some pointers of how to go about troubleshooting this.

RT 3.0.10, Perl 5.8.2 (ick), MySQL 4.0.16, FreeBSD 5.2-CURRENT

Thanks,
Dustin

Time: 040826 10:32:15

User@Host: rt_user[rt_user] @ localhost []

Query_time: 1294 Lock_time: 0 Rows_sent: 1 Rows_examined: 0

SELECT GET_LOCK(‘Apache-Session-ae38b18e1826f57e5ac417069b4dd822’, 3600);

Time: 040826 10:21:31

User@Host: rt_user[rt_user] @ localhost []

Query_time: 1185 Lock_time: 0 Rows_sent: 1 Rows_examined: 0

SELECT GET_LOCK(‘Apache-Session-ae38b18e1826f57e5ac417069b4dd822’, 3600);

Time: 040826 10:27:02

User@Host: rt_user[rt_user] @ localhost []

Query_time: 1500 Lock_time: 0 Rows_sent: 1 Rows_examined: 0

SELECT GET_LOCK(‘Apache-Session-ae38b18e1826f57e5ac417069b4dd822’, 3600);

Time: 040826 10:16:05

User@Host: rt_user[rt_user] @ localhost []

Query_time: 861 Lock_time: 0 Rows_sent: 1 Rows_examined: 0

SELECT GET_LOCK(‘Apache-Session-ae38b18e1826f57e5ac417069b4dd822’, 3600);

Time: 040826 10:38:13

User@Host: rt_user[rt_user] @ localhost []

Query_time: 1465 Lock_time: 0 Rows_sent: 1 Rows_examined: 0

SELECT GET_LOCK(‘Apache-Session-ae38b18e1826f57e5ac417069b4dd822’, 3600);

User@Host: rt_user[rt_user] @ localhost []

Query_time: 516 Lock_time: 0 Rows_sent: 1 Rows_examined: 0

SELECT GET_LOCK(‘Apache-Session-ae38b18e1826f57e5ac417069b4dd822’, 3600);

User@Host: rt_user[rt_user] @ localhost []

Query_time: 423 Lock_time: 0 Rows_sent: 1 Rows_examined: 0

SELECT GET_LOCK(‘Apache-Session-ae38b18e1826f57e5ac417069b4dd822’, 3600);

Time: 040826 13:13:34

User@Host: rt_user[rt_user] @ localhost []

Query_time: 3 Lock_time: 0 Rows_sent: 17 Rows_examined: 71

SELECT DISTINCT main.* FROM ( Groups main LEFT JOIN Principals as
Principals_2 ON ( main.id = Principals_2.id)), ACL ACL_1 WHERE
((ACL_1.RightName = ‘OwnTicket’)OR(ACL_1.RightName = ‘SuperUser’)) AND
((Principals_2.Disabled = ‘0’)) AND
( ( ACL_1.PrincipalId = main.id
AND ACL_1.PrincipalType = 'Group’
AND ( main.Domain = 'SystemInternal’
OR main.Domain = 'UserDefined’
OR main.Domain = ‘ACLEquivalence’))
OR ( ( (main.Domain = ‘RT::Queue-Role’ AND main.Instance = 4)
OR ( main.Domain = ‘RT::Ticket-Role’ AND main.Instance = 331092) ) AND
main.Type = ACL_1.PrincipalType) )
AND (ACL_1.ObjectType = ‘RT::System’ OR (ACL_1.ObjectType =
‘RT::Queue’ AND ACL_1.ObjectId = 4) ) ORDER BY main.Name ASC;