InnoDB indexes

https://dev.mysql.com/doc/refman/5.6/en/innodb-indexes.html

  1. clustered index
    Every InnoDB table has a special index called the clustered index.

  2. primary key
    Typically, the clustered index is synonymous with the [primary key].

clustered index: 等同于primary key

  1. InnoDB table 一定会有 clustered index

1⃣️ table 定义了 primary key column

2⃣️ table 没有定义 primary key column, 但是定义了 unique not null 字段, 选取第一个合适的 unique not null 字段作为 clustered index

3⃣️ table 没有定义 primary key 字段和并且没有定义合适的 unique not null 字段, 则自动定义一个隐藏字段, 作为 clustered index

  1. secondary indexes:
    非 clustered index 都是 secondary index
  1. InnoDB仅支持 b-trees index数据结构。
  1. 支持全文索引:
    CREATE TABLE opening_lines (
    id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
    opening_line TEXT(500),
    author VARCHAR(200),
    title VARCHAR(200),
    FULLTEXT idx (opening_line)
    ) ENGINE=InnoDB;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值