How to hint the index to use in a MySQL select query?

前端 未结 4 1494
轮回少年
轮回少年 2020-12-29 19:04

I have a MySQL query (running MySQL 5.0.88), which I\'m trying to speed up. The underlying table has multiple indices and for the query in question, the wrong index is used

4条回答
  •  情歌与酒
    2020-12-29 19:34

    Select Coloumn1,Coloumn2,Coloumn.... FROM TABLE_NAME USE INDEX(index_name) WHERE Coloumn="condition";

    if you have correct index thn you dnt need to use index(). your query automic select correct index.If your query slow after using index thn recheck your index ,something wrong in index. thanks in advance.enter code here

提交回复
热议问题