加入收藏 | 设为首页 | 会员中心 | 我要投稿 济南站长网 (https://www.0531zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

MySQL索引性能测验

发布时间:2022-04-12 11:51:53 所属栏目:MySql教程 来源:互联网
导读:很长一段时间没学习MySQL了,一直致力于oracle的研究,最近得空了就再拾起MySQL看看吧,记得去年发布过的2篇MySQL文章: 今天我们就来看看mysql中索引的性能测试: 1 准备环境 1.1 在数据库中创建测试表test1 [root@rhel6_lhr ~]# mysql -p Enter password
         很长一段时间没学习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索引性能测验
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)

(编辑:济南站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读