Mysql Explain Ïê½â[Ç¿ÁÒÍƼö]
Mysql Explain Ïê½â
Ò».Óï·¨
explain < table_name >
ÀýÈç: explain select * from t3 where id=3952602;
¶þ.explainÊä³ö½âÊÍ
+----+-------------+-------+-------+-------------------+---------+---------+-------+------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+-------+-------------------+---------+---------+-------+------+-------+
1.id
ÎÒµÄÀí½âÊÇSQLÖ´ÐеÄ˳ÀûµÄ±êʶ,SQL´Ó´óµ½Ð¡µÄÖ´ÐÐ.
ÀýÈç:
mysql> explain select * from (select * from ( select * from t3 where id=3952602) a) b;
+----+-------------+------------+--------+-------------------+---------+---------+------+------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+--------+-------------------+---------+---------+------+------+-------+
| 1 | PRIMARY | <derived2> | system | NULL | NULL | NULL | NULL | 1 | |
| 2 | DERIVED | <derived3> | system | NULL | NULL | NULL | NULL | 1 | |
| 3 | DERIVED | t3 | const | PRIMARY,idx_t3_id | PRIMARY | 4 | | 1 | |
+----+-------------+------------+--------+-------------------+---------+---------+------+------+-------+
ºÜÏÔÈ»ÕâÌõSQLÊÇ´ÓÀïÏòÍâµÄÖ´ÐÐ,¾ÍÊÇ´Óid=3 ÏòÉÏÖ´ÐÐ.
2. select_type
¾ÍÊÇselectÀàÐÍ,¿ÉÒÔÓÐÒÔϼ¸ÖÖ
(1) SIMPL
Ïà¹ØÎĵµ£º
MYSQL Ó¦ÓÃÊ®·Ö¹ã·¶£¬ºÜ¶àÍøÕ¾¼¸ºõ¶¼ÔÚÓÃËû£¬ÒòΪËûµÄСÇɺÍÁé»îÐԵȷ½ÃæÈÃÎÒ¾ö¶¨Òª¶ÔËû½øÐÐÑо¿£¬µ½ÏÖÔÚÒѾ³É¹¦µÄ²»Óþ¹ýODBC£¬ADOµÈ·½Ê½¾Í¿ÉÒÔ¶ÁÈ¡ºÍ¸üÐÂÊý¾Ý¡£
ºÃÁ˲»¶àÂÞ࣬ÒÔÏÂÎÒÀ´½éÉÜ×ܸö³ÌÐòµÄϸ½Ú:
£¨Ò»£©APIÉùÃ÷
1. '·ÖÅä»ò³õʼ»¯ÊʺÏmysql_real_connect()µÄÒ»¸öMYSQL¶ÔÏñ¡ ......
¸Õ¸Õ°²×°Íêmysqlºó
´ÓcmdÖнøÈëmysqlÊý¾Ý¿â
ÃüÁîÐÐÖÐÊäÈ룺
mysql -uroot -p123
½øÈëmysqlÊý¾Ý¿âÖÐ
ÃüÁîÐÐÖÐÊäÈë:
status;
²é¿´µ±Ç°Êý¾Ý¿âÖеıàÂë
ÈçÏ£º
--------------
mysql Ver 14.12 Distrib 5.1.7-beta, for Win32 (ia32)
Connection id: &nb ......
Ê×ÏÈ£¬½¨InnoDBÀàÐÍµÄ±í£¬²ÅÄÜÖ§³ÖÊÂÎñ
$handler = mysql_connect('localhost', '', '');
mysql_select_db('test');
mysql_query('SET AUTOCOMMIT=0'); // ÉèÖÃΪ²»×Ô¶¯Ìá½»²éѯ
mysql_query('START TRANSACTION'); // ¿ªÊ¼²éѯ£¬ÕâÀïÒ²¿ÉÒÔʹÓÃBEGIN
mysql_query("INSERT INTO users VALUES ('ccc')");
mysql_query( ......
1.ͨ¹ýÐÞ¸ÄMYSQLÊý¾Ý¿âÖÐMYSQL¿âµÄUSER±í
¾ÍÓÃÆÕͨµÄUPDATE¡¢INSERTÓï¾ä¾Í¿ÉÒÔ
use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
£¨Õâ¸öÇ××ÔʵÑé¹ý£¬¿ÉÒÔÖ´ÐУ¡£©
2.ÔÚÃüÁîÐÐÖÐʹÓÃÈçÏÂÃüÁî
&nbs ......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......