mysql fix Using where;

后端 未结 1 1004
春和景丽
春和景丽 2020-12-09 17:25

My SQL Query:

SELECT *
FROM updates_cats
WHERE uid =118697835834
ORDER BY created_date ASC

Current Indexes:

index1(uid, cre         


        
相关标签:
1条回答
  • 2020-12-09 17:30

    The only thing that would be better than Using where is Using where; Using index with a "covering index". Try selecting just uid and created_date.

    Using where is fine. It means it's applying the indicated index to the WHERE clause and reducing the rows returned. To get rid of it, you'd have to get rid of the WHERE clause.

    Here are things that you should be concerned about:

    • Using filesort
    • Using temporary
    • Not using an index: NULL in the 'key' column of the EXPLAIN and a large number of rows in the 'rows' column.

    Your EXPLAIN result shows that MySQL is applying index1 to the WHERE clause and returning 2 rows:

    1 SIMPLE updates_cats ref index1 index1 8 const 2 100.00 Using where
    
    0 讨论(0)
提交回复
热议问题