mysql -h192.168.0.150 -uroot -p
新建索引:
create index indexName on table(columnName)
显示建表语句:
SHOW CREATE TABLE table_name
mysql 索引花费时间:
mysql> select count(*) from dac_traffic_channel_day_201202;
+----------+
| count(*) |
+----------+
| 1378899 |
+----------+
1 row in set (12.11 sec)
mysql> create index index_id on dac_traffic_channel_day_201202(id);
Query OK, 0 rows affected (22.07 sec)
Records: 0 Duplicates: 0 Warnings: 0
MySQL索引优化实践
本文介绍了MySQL中如何创建索引来提高查询效率,并展示了通过建立id索引,显著减少了查询dac_traffic_channel_day_201202表所需的时间。
5293

被折叠的 条评论
为什么被折叠?



