Optimize query to minimize tmp copying time I have a query when Checking the profile i get this :



I read in order to optimize this i'll have to work on my joins .

I also added index on the fields that i'm grouping by (date_seance , heure_debut) in the main table (seance_pratique)



Is there something i can do to make it faster ?

Update 1 (EXPLAIN QUERY):
Review indexing on cours table as you're getting a full table scan there. 

http://mysql.rjweb.org/doc.php/ricksrots

Great indexing tips there ^