很长一段时间没学习MySQL了,一直致力于oracle的研究,最近得空了就再拾起MySQL看看吧,记得去年发布过的2篇MySQL文章:
  
       今天我们就来看看mysql中索引的性能测试:
      1  准备环境
     1.1  在数据库中创建测试表test1
[root@rhel6_lhr ~]# mysql -p
 
Enter password:
 
Welcome to the MySQL monitor.  Commands end with ; or \g.
 
Your MySQL connection id is 14
 
Server version: 5.6.21-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
 
mysql> show databases;
 
+--------------------+
 
| Database           |
 
+--------------------+
 
| information_schema |
 
| db1                |
 
| db4                |
 
| lhr_test           |
 
| mysql              |
 
| opensource         |
 
| opesource          |
 
| performance_schema |
 
| test               |
 
| wyzc               |
 
+--------------------+
 
10 rows in set (0.00 sec)
  
mysql> use lhr_test;
 
Reading table information for completion of table and column names
 
You can turn off this feature to get a quicker startup with -A
 
mysql> desc test1;
 
+-------+-------------+------+-----+---------+-------+
 
| Field | Type        | Null | Key | Default | Extra |
 
+-------+-------------+------+-----+---------+-------+
 
| id    | int(11)     | YES  |     | NULL    |       |
 
| num   | int(11)     | YES  |     | NULL    |       |
 
| pass  | varchar(50) | YES  |     | NULL    |       |
 
+-------+-------------+------+-----+---------+-------+
 
3 rows in set (0.00 sec)
 
mysql> create table test3(
 
    ->  id int,
 
    ->  num int,
 
    ->  pass varchar(50)
 
    ->  );
 
reset query cache;Query OK, 0 rows affected (0.09 sec)

dawei

【声明】:站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。