-- No force index explain select count(1) from SAKAI_REALM_RL_FN MAINTABLE LEFT JOIN SAKAI_REALM_RL_GR GRANTED_ROLES ON (MAINTABLE.REALM_KEY = GRANTED_ROLES.REALM_KEY AND MAINTABLE.ROLE_KEY = GRANTED_ROLES.ROLE_KEY), SAKAI_REALM REALMS, SAKAI_REALM_ROLE ROLES, SAKAI_REALM_FUNCTION FUNCTIONS where (ROLES.ROLE_NAME in ('.anon' , '.auth') or (GRANTED_ROLES.USER_ID = '818c36fc-1b99-467e-005b-f88aa2cc3776' AND GRANTED_ROLES.ACTIVE = 1)) AND FUNCTIONS.FUNCTION_NAME = 'annc.all.groups' AND REALMS.REALM_ID in ('/site/f5919030-c96f-4b69-af0c-ee206fd555bc') AND MAINTABLE.REALM_KEY = REALMS.REALM_KEY AND MAINTABLE.FUNCTION_KEY = FUNCTIONS.FUNCTION_KEY AND MAINTABLE.ROLE_KEY = ROLES.ROLE_KEY;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE REALMS const PRIMARY, AK_SAKAI_REALM_ID AK_SAKAI_REALM_ID 767 const 1 Using index
1 SIMPLE FUNCTIONS const PRIMARY, IE_SAKAI_REALM_FUNCTION_NAME, SAKAI_REALM_FUNCTION_KN IE_SAKAI_REALM_FUNCTION_NAME 299 const 1 Using index
1 SIMPLE ROLES index PRIMARY, IE_SAKAI_REALM_ROLE_NAME IE_SAKAI_REALM_ROLE_NAME 299 NULL 39 Using index
1 SIMPLE MAINTABLE eq_ref PRIMARY, FK_SAKAI_REALM_RL_FN_REALM, FK_SAKAI_REALM_RL_FN_FUNC, FJ_SAKAI_REALM_RL_FN_ROLE PRIMARY 12 const, sakai_live.ROLES.ROLE_KEY, const 1 Using index
1 SIMPLE GRANTED_ROLES ref PRIMARY, FK_SAKAI_REALM_RL_GR_REALM, FK_SAKAI_REALM_RL_GR_ROLE, SAKAI_REALM_RL_GR_RAU SAKAI_REALM_RL_GR_RAU 4 sakai_live.MAINTABLE.ROLE_KEY 28131 Using where; Using index
-- force index select count(1) from SAKAI_REALM_RL_FN MAINTABLE FORCE INDEX (PRIMARY) LEFT JOIN SAKAI_REALM_RL_GR GRANTED_ROLES FORCE INDEX (PRIMARY) ON (MAINTABLE.REALM_KEY = GRANTED_ROLES.REALM_KEY AND MAINTABLE.ROLE_KEY = GRANTED_ROLES.ROLE_KEY), SAKAI_REALM REALMS, SAKAI_REALM_ROLE ROLES, SAKAI_REALM_FUNCTION FUNCTIONS where (ROLES.ROLE_NAME in ('.anon' , '.auth') or (GRANTED_ROLES.USER_ID = '818c36fc-1b9s9-467e-005b-f88aa2cc3776' AND GRANTED_ROLES.ACTIVE = 1)) AND FUNCTIONS.FUNCTION_NAME = 'annc.all.groups' AND REALMS.REALM_ID in ('/site/f5919030-c96f-4b69-af0c-ee206fd555bc') AND MAINTABLE.REALM_KEY = REALMS.REALM_KEY AND MAINTABLE.FUNCTION_KEY = FUNCTIONS.FUNCTION_KEY AND MAINTABLE.ROLE_KEY = ROLES.ROLE_KEY;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE REALMS const PRIMARY, AK_SAKAI_REALM_ID AK_SAKAI_REALM_ID 767 const 1 Using index
1 SIMPLE FUNCTIONS const PRIMARY, IE_SAKAI_REALM_FUNCTION_NAME, SAKAI_REALM_FUNCTION_KN IE_SAKAI_REALM_FUNCTION_NAME 299 const 1 Using index
1 SIMPLE ROLES index PRIMARY, IE_SAKAI_REALM_ROLE_NAME IE_SAKAI_REALM_ROLE_NAME 299 NULL 39 Using index
1 SIMPLE MAINTABLE eq_ref PRIMARY PRIMARY 12 const, sakai_live.ROLES.ROLE_KEY, const 1 Using index
1 SIMPLE GRANTED_ROLES ref PRIMARY PRIMARY 4 const 30014 Using where