27

MySQL 8 新特性之降序索引底层实现-wx5cb6d3d725767的博客

 4 years ago
source link: https://blog.51cto.com/14295088/2414709
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
大家可能对索引比较熟悉,而对降序索引比较陌生,事实上降序索引是索引的子集。我们通常使用下面的语句来创建一个索引:create index idx_t1_bcd on t1(b,c,d);上面sql的意思是在t1表中,针对b,c,d三个字段创建一个联合索引。但是大家不知道的是,上面这个sql实际上和下面的这个sql是等价的:create index idx_t1_bcd on t1(b asc,c asc,d asc);asc表示的是升序,使用这种语法创建出来的索引叫做升序索引。也就是我们平时在创建索引的时候,创建的都是升序索引。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK