首页 > 数据库技术 > 详细

mysql index 8.0

时间:2021-04-20 15:57:51      阅读:18      评论:0      收藏:0      [点我收藏+]

创建表

use vodb;
drop table if exists test1;
create table  test1(id  int NOT NULL AUTO_INCREMENT primary key COMMENT 主键,uid int, tid int,tname varchar(12),tvalue varchar(90),createtime datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT 创建时间,key tid(tid),unique key uid(uid)) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4;

 

 

倒序索引,Backward index scan

mysql> explain select * from test1 where tid < 10 order by tid desc;
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------------------------+
| id | select_type | table | partitions | type  | possible_keys | key  | key_len | ref  | rows | filtered | Extra                                      |
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------------------------+
|  1 | SIMPLE      | test1 | NULL       | range | tid           | tid  | 5       | NULL |   91 |   100.00 | Using index condition; Backward index scan |
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+--------------------------------------------+
1 row in set, 1 warning (0.00 sec)

 

mysql index 8.0

原文:https://www.cnblogs.com/perfei/p/14680879.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!