Using temporary, using filesort a bad idea in mysql?

后端 未结 3 1906
难免孤独
难免孤独 2021-01-05 10:30

I am trying to optimize my mysql queries to avoid \'using temporary, using filesort\'. I could use some help. First; here is the explain

Here is the Query

         


        
3条回答
  •  情书的邮戳
    2021-01-05 11:12

    That's the most efficient way to write that query.

    Make sure that pf.friend_id, pf.member_id, and m.id have indices on them. Then it will use the indices to join the tables and filter the results.

    That sort is going to come up, anyway, because of your order by.

提交回复
热议问题