Five, mysql optimization technology - sql statement optimization

group by optimization

By default, mysq sorts all group bys, which is similar to specifying order by in the query. If you want to avoid the inefficiency caused by sorting, you can use order by null to disable sorting

 

In some cases, you can use join instead of subqueries, because using join, mysql does not need to create a temporary table in memory

 

If you want to use an index in a query statement containing an or, each conditional column between or must use an index

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326475388&siteId=291194637