码迷,mamicode.com
首页 > 数据库 > 详细

mysql中更改字段属性实际上都做了哪些操作

时间:2014-09-07 09:49:24      阅读:362      评论:0      收藏:0      [点我收藏+]

标签:style   color   io   ar   strong   for   art   sp   on   

 mysql> set profiling=1;

Query OK, 0 rows affected (0.00 sec)

mysql> alter table test modify name varchar(10);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0

mysql> show profiles;
+----------+------------+------------------------------------------+
| Query_ID | Duration | Query |
+----------+------------+------------------------------------------+
| 1 | 0.00011200 | alter table test name varchar(10) |
| 2 | 0.00596700 | alter table test modify name varchar(10) |
+----------+------------+------------------------------------------+
2 rows in set (0.00 sec)

mysql> show profile for query 2;
+----------------------+----------+
| Status | Duration |
+----------------------+----------+
| starting | 0.000063 |
| checking permissions | 0.000002 |
| checking permissions | 0.000008 |
| init | 0.000049 |
| Opening tables | 0.000013 |
| System lock | 0.000005 |
| Table lock | 0.000010 |
| setup | 0.000034 |
| creating table | 0.005007 |
| After create | 0.000131 |
| copy to tmp table | 0.000109 |
| rename result table | 0.000355 |
| end | 0.000037 |
| query end | 0.000003 |
| freeing items | 0.000138 |
| cleaning up | 0.000003 |
+----------------------+----------+
16 rows in set (0.00 sec)

mysql中更改字段属性实际上都做了哪些操作

标签:style   color   io   ar   strong   for   art   sp   on   

原文地址:http://www.cnblogs.com/lehao/p/3960128.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!