当前位置:网站首页>MySQL learning record 07 index (simple understanding)

MySQL learning record 07 index (simple understanding)

2022-07-06 08:26:00 Jatine

MySQL Learning record 07 Indexes ( Simple understanding )

MySQL The official definition of index is : Indexes (Index) Help MySQL Data structure for efficient data acquisition .
Extract the sentence trunk , We can get the essence of index : An index is a data structure .《 Article, understand MySQL Indexes ( clear )》

7.1 Classification of indexes

  • General index (KEY/INDEX)
    default
  • unique index (UNIQUE KEY)
    Avoid duplicate columns , The unique index can be repeated , Multiple columns can be identified as unique indexes
  • primary key (PRIMARY KEY)
    Unique identification , The primary key cannot be repeated , There can only be one column as the primary key
  • Full-text index (FullText)
    Only under the specific database engine
    Quickly locate data

7.2 Indexing principles

  • More indexes is not better
  • Don't index frequently changing data
  • A table with a small amount of data does not need to be indexed
  • The index is usually added to the fields commonly used for query
原网站

版权声明
本文为[Jatine]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131825406434.html