【问题标题】:Why my table is not using Index?为什么我的表没有使用索引?
【发布时间】:2010-07-01 10:44:57
【问题描述】:

我看不到我的表正在使用 Index...EXPLAIN 给了我这个

id select_type  table      type  possible_keys  key key_len  ref   rows Extra
1  SIMPLE           table1     const  web       web  258     const  1    
1  SIMPLE           table2     const  web       web  258     const  1    
1  SIMPLE           table3     const  web       web  258     const  1    
1  SIMPLE           table4     const  web       web  258     const  1   

【问题讨论】:

  • 如果你能提供表定义,那会很有帮助。
  • keyindex 是相同的。你的问题是什么?我在answer to one of your previous questions 中合理详细地解释了您的EXPLAIN 语句的输出。
  • 抱歉,extra 没有显示“使用索引”消息,因此我认为它没有使用索引

标签: mysql database


【解决方案1】:

它正在使用名为web 的索引。键表示索引。

id select_type table type possible_keys key key_len ref rows Extra 1 简单表 1 const web web 258 const 1 1 简单表 2 const web web 258 const 1 1 简单表 3 const web web 258 const 1 1 简单表 4 const web web 258 const 1 ^^^

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多