首页 > 数据库 > MySQL > 正文

MySQL索引性能测验

2024-07-24 12:32:43
字体:
来源:转载
供稿:网友
         很长一段时间没学习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)

(编辑:武林网)

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表