如何解释MySQL EXPLAIN的输出? [英] How to interpret the output of MySQL EXPLAIN?

查看:90
本文介绍了如何解释MySQL EXPLAIN的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从entrytable中选择列text的内容.

I want to select the content of the column text from entrytable.

EXPLAIN SELECT text
FROM entrytable
WHERE user = 'username' &&
`status` = '1' && (
    `status_spam_user` = 'no_spam'
    || (
        `status_spam_user` = 'neutral' &&
        `status_spam_system` = 'neutral'
    )
)
ORDER BY datum DESC
LIMIT 6430 , 10

该表具有三个索引:

  • index_user(用户)
  • index_datum(基准)
  • index_status_mit_spam(状态,status_spam_user,status_spam_system)

EXPLAIN结果为:

The EXPLAIN result is:

id  select_type     table       type    possible_keys                       key         key_len     ref     rows    Extra
1   SIMPLE          entrytable  ref     index_user,index_status_mit_spam    index_user  32          const   7800    Using where; Using filesort

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆