mysql中更改字段属性实际上都做了哪些操作
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)
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。