Using temporary, using filesort a bad idea in mysql?

后端 未结 3 1905
难免孤独
难免孤独 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:07

    It is a problem? Yeah.

    Is it a problem when you're dealing with 160 rows? Nope.

    "Filesort" is a method, not the actual creation of a file and sorting it. If we were talking about 160,000 rows instead of 160 rows, then there'd probably be reason to consider further optimizations.

    Edit: Also, you omitted the actual query running time. You're hitting indexes and only working with a handful of rows. If this query is taking more than a fraction of a fraction of a second, it's probably not worth even looking at for optimization.

提交回复
热议问题