I'm doing some database (Moodle 3.8 MariaDB) optimization effort in our system and noticed some (maybe?) redundant indexes in table mdl_role_assignments:
1. mdl_roleassi_rol_ix on field roleid:
roleid is already the most significat col in index mdl_roleassi_rolcon_ix
2. mdl_roleassi_use_ix on field userid:
userid is already the most significant col in index mdl_roleassi_useconrol_ix
AFAIK those indexes are redundant as the DB optimizer will know how to fetch rows from the later indexes.
Now, I know they are considered foreign keys to the user and role tables, but it is a common practice to avoid duplicate indexes as such.
Do you see a reason for that?
Do you think they can be removed without any performance impact?