How to not replicate index creation on ignored tables in MySQL/MariaDB
Plan A:  Include the index(es) in the CREATE TABLE statement.

Plan B:  Use this to add an index:

ALTER TABLE moodle.mdl_temp_stats_daily ADD INDEX(courseid);


(I have not tested either.)