explain SELECT COUNT(DISTINCT main.id) FROM Tickets main 
      JOIN Groups Groups_1 ON ( Groups_1.Domain = 'RT::Ticket-Role' ) AND ( Groups_1.Type = 'Requestor' ) AND ( Groups_1.Instance = main.id ) 
      JOIN CachedGroupMembers CachedGroupMembers_18  ON (CachedGroupMembers_18.GroupId = Groups_1.id ) 
      JOIN CachedGroupMembers CachedGroupMembers_8   ON ( CachedGroupMembers_8.GroupId = Groups_1.id )
      JOIN CachedGroupMembers CachedGroupMembers_16  ON ( CachedGroupMembers_16.GroupId = Groups_1.id ) 
      JOIN CachedGroupMembers CachedGroupMembers_12  ON ( CachedGroupMembers_12.GroupId = Groups_1.id ) 
      JOIN CachedGroupMembers CachedGroupMembers_2   ON (CachedGroupMembers_2.GroupId = Groups_1.id ) 
      JOIN CachedGroupMembers CachedGroupMembers_6   ON ( CachedGroupMembers_6.GroupId = Groups_1.id )
      JOIN CachedGroupMembers CachedGroupMembers_4   ON ( CachedGroupMembers_4.GroupId = Groups_1.id ) 
      JOIN CachedGroupMembers CachedGroupMembers_14  ON ( CachedGroupMembers_14.GroupId = Groups_1.id ) 
      JOIN CachedGroupMembers CachedGroupMembers_10  ON ( CachedGroupMembers_10.GroupId = Groups_1.id )
 LEFT JOIN Users Users_15  ON ( Users_15.id = CachedGroupMembers_14.MemberId )
 LEFT JOIN Users Users_7   ON ( Users_7.id = CachedGroupMembers_6.MemberId )
 LEFT JOIN Users Users_17  ON ( Users_17.id = CachedGroupMembers_16.MemberId )
 LEFT JOIN Users Users_5   ON ( Users_5.id = CachedGroupMembers_4.MemberId )
 LEFT JOIN Users Users_3   ON ( Users_3.id = CachedGroupMembers_2.MemberId )
 LEFT JOIN Users Users_13  ON ( Users_13.id = CachedGroupMembers_12.MemberId )
 LEFT JOIN Users Users_19  ON ( Users_19.id = CachedGroupMembers_18.MemberId )
 LEFT JOIN Users Users_9   ON ( Users_9.id = CachedGroupMembers_8.MemberId )
 LEFT JOIN Users Users_11  ON ( Users_11.id = CachedGroupMembers_10.MemberId )
WHERE
(  main.Status != 'deleted' )
AND (
      main.Created > '2010-08-31 14:00:00'
      AND (
            ( Users_3.EmailAddress = 'user1@redhat.com' )
        OR  ( Users_5.EmailAddress = 'user2@redhat.com' )
        OR  ( Users_7.EmailAddress = 'user3@redhat.com' )
        OR  ( Users_9.EmailAddress = 'user4@redhat.com' )
        OR  ( Users_11.EmailAddress = 'user5@redhat.com' )
        OR  ( Users_13.EmailAddress = 'user6@redhat.com' )  
        OR  ( Users_15.EmailAddress = 'user7@redhat.com' )
        OR  ( Users_17.EmailAddress = 'user8@redhat.com' )
        OR  ( Users_19.EmailAddress = 'user9@redhat.com' )
    )
)
AND (main.Type = 'ticket')
AND (main.EffectiveId = main.id)
;
