MySQL not using index when checking = 1 , but using it with = 0

前端 未结 2 1813
情话喂你
情话喂你 2021-02-02 04:13

Here is a perplexing issue I am having:

Query:
EXPLAIN SELECT id,hostname FROM queue_servers WHERE live=1

id  select_type     table   type    possible_keys   ke         


        
2条回答
  •  离开以前
    2021-02-02 04:49

    Have you tried enforcing a particular index for search ? http://dev.mysql.com/doc/refman/5.0/en/index-hints.html

    You can tell the DBMS to use a proper index for the query. That should give you predictable behaviour.

提交回复
热议问题