Looking closer, I see that you have an index on each of `user` and `course_id` individually, but given that the most common query is going to use both, I think a joint index is more important.