+----+-------------+--------+------+---------------------------+-----------+---------+-------------------------+------+--------------------------+
| id | select_type | table  | type | possible_keys             | key       | key_len | ref                     | rows | Extra                    |
+----+-------------+--------+------+---------------------------+-----------+---------+-------------------------+------+--------------------------+
|  1 | SIMPLE      | btitle | ref  | bbdbshr,btdbshi,bbtdbshri | bbtdbshri | 316     | const,const,const,const | 3656 | Using where; Using index | 
+----+-------------+--------+------+---------------------------+-----------+---------+-------------------------+------+--------------------------+
有几列字段不是太清楚。
ref字段从文档中看,是一个常量。在这里却是const,const,const,const,这个表示什么意思?
Extra字段Using where; Using index 表示什么意思?出现类似Using index、Using filesort和Using temporary是否表示该语句有可能出现性能问题?

解决方案 »

  1.   

    -- 用 \G 去查看,这样:你就更一目了然啦:
    mysql-[groupon]> explain select max(id) from t_Groupon_order
        -> where from_unixtime(create_time/1000)<CURDATE()\G
    *************************** 1. row ***************************
               id: 1
      select_type: SIMPLE
            table: t_Groupon_order
             type: index
    possible_keys: NULL
              key: ORDER_PAID_INDEX
          key_len: 20
              ref: NULL
             rows: 6711312
            Extra: Using where; Using index
    1 row in set (0.00 sec)
      

  2.   

    兄弟,用explain是一样的。但是,我问的是某个字段的含义,而不是打印查看。
      

  3.   

    mysql> EXPLAIN SELECT btitle.id FROM tables btitle WHERE btitle.BoardID_1='Y' AND btitle.BoardID_2='X' AND btitle.deleted=0 AND btitle.titleType='1'  LIMIT 0,30;
    这个是我的SQL语句
      

  4.   

    现在,我不知道出现Using where; Using index,对查询语句有多大的影响。总感觉只出现Using where;是最好的。
      

  5.   

    EXPLAIN SELECT btitle.id FROM tables btitle WHERE btitle.BoardID_1='Y' AND btitle.BoardID_2='X' AND btitle.deleted=0 AND btitle.titleType='1'  LIMIT 0,30;
    这个不报错? 
      

  6.   

    http://www.blogjava.net/persister/archive/2008/10/27/236813.html