Mysql> explain extended select count (*) from xuehao;
+ ---- + ------------- + ------- + ------ + --------------- + ------ + --------- + ------ + ---------- + -------------------------------- +
| ID | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | extra |
+ ---- + ------------- + ------- + ------ + --------------- + ------ + --------- + ------ + ---------- + -------------------------------- +
| 1 | simple | null | select tables optimized away |
+ ---- + ------------- + ------- + ------ + --------------- + ------ + --------- + ------ + ---------- + -------------------------------- +
1 row in set, 1 warning (0.00 Sec)
Mysql> show warnings;
+ ------- + ------ + ------------------------------------------------------------------- +
| Level | code | message |
+ ------- + ------ + ------------------------------------------------------------------- +
| Note | 1003 |/* select #1 */select count (0) as 'count (*) 'from 'lina'. 'xuehao' |
+ ------- + ------ + ------------------------------------------------------------------- +
Optimize the SQL rewriting before the SQL statement is actually executed.
| Level | code | message |
+ ------- + ------ + ------------------------------------------------------------------- +
| Note | 1003 |/* select #1 */select count (0) as 'count (*) 'from 'lina'. 'xuehao' |
+ ------- + ------ + ------------------------------------------------------------------- +
1 row in SET (0.00 Sec)
Mysql4.1 introduced the explain extended command.
Explain extended; show warnings