MariaDB [rt3]> explain extended SELECT DISTINCT main.* FROM Tickets main CROSS JOIN Users Users_3 JOIN Groups Groups_1 ON ( Groups_1.Domain = 'RT::Ticket-Role' ) AND ( Groups_1.Type = 'Requestor' ) AND ( Groups_1.Instance = main.id ) LEFT JOIN CachedGroupMembers CachedGroupMembers_2 ON ( CachedGroupMembers_2.MemberI d = Users_3.id ) AND ( CachedGroupMembers_2.GroupId = Groups_1.id ) WHERE (Users_3.Name = 'IT-System') AND (main.Status != 'deleted') AND ( ( main.Owner = '2281908' OR ( CachedGroupMembers_2.id IS NOT NULL ) ) AND ( main.Status = 'new' OR main.Status = 'open' ) ) AND (main.Type = 'ticket') AND (main.EffectiveId = main.id) ORDER BY main.LastUpdated DESC LIMIT 50; +------+-------------+----------------------+-------+-------------------------------------------------------------------------------------+------------------+---------+-------------------------+------+----------+------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +------+-------------+----------------------+-------+-------------------------------------------------------------------------------------+------------------+---------+-------------------------+------+----------+------------------------------------+ | 1 | SIMPLE | Users_3 | const | Users1 | Users1 | 202 | const | 1 | 100.00 | Using index; Using temporary | | 1 | SIMPLE | main | index | PRIMARY,Tickets2,Tickets6,created,apid_status,apid_owner,apid_type,apid_effectiveid | apid_lastupdated | 6 | NULL | 2641 | 100.00 | Using where | | 1 | SIMPLE | Groups_1 | ref | Groups1,Groups2 | Groups1 | 139 | const,rt3.main.id,const | 1 | 100.00 | Using where; Using index; Distinct | | 1 | SIMPLE | CachedGroupMembers_2 | ref | DisGrouMem,main,SHREDDER_CGM1 | DisGrouMem | 10 | rt3.Groups_1.id,const | 1 | 100.00 | Using where; Using index; Distinct | +------+-------------+----------------------+-------+-------------------------------------------------------------------------------------+------------------+---------+-------------------------+------+----------+------------------------------------+