NSLM (nslm) wrote,
NSLM
nslm

Slow DB queries...

I'm currently trying to upgrade a copy of RT including a mass of customizations...

The vast bulk of this appears to be leading to a reasonable speed increase. One page is running rather slow. The "Search Query Builder". Watch what's going on on the server. MySQL is getting somewhat hammered. Turn on the slow query logging.


==> /var/lib/mysql/$SERVERNAME-slow.log <==
# Time: 070810 10:36:37
# User@Host: $USERNAME[$USERNAME] @ localhost []
# Query_time: 47 Lock_time: 0 Rows_sent: 624 Rows_examined: 6908112
SELECT DISTINCT main.* FROM Users main , Principals Principals_1, CachedGroupMembers CachedGroupMembers_2, Groups Groups_3, ACL ACL_4 WHERE ((ACL_4.PrincipalType = Groups_3.Type)) AND ((ACL_4.RightName = 'OwnTicket')) AND ((CachedGroupMembers_2.MemberId = Principals_1.id)) AND ((Groups_3.id = CachedGroupMembers_2.GroupId)) AND ((Principals_1.Disabled = '0')) AND ((Principals_1.PrincipalType = 'User')) AND ((Principals_1.id != '1')) AND ((main.id = Principals_1.id)) AND ((ACL_4.ObjectType = 'RT::Queue') OR (ACL_4.ObjectType = 'RT::System')) AND ((Groups_3.Domain = 'RT::Queue-Role') OR (Groups_3.Domain = 'RT::System-Role')) ORDER BY main.Name ASC;


Hmmm just shy of 7 million rows being queried, for 624 results, that might do it.
Subscribe

  • Wierd and wonderful Kerberos Errors

    Got called out last night because most of our services stopped letting people in. Kerberos was giving the wonderful error: "Server's entry in…

  • Training

    A month or so back I was supposed to be going on a Red Hat training course in London ( RHS429) unfortunately this got cancelled as only 2 people had…

  • Perl

    In the middle of writing some perl test cases for code I've been writing (Trying to avoid writing the rest of the documentation) Failed 4/15 test…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments