MySQL 索引操作總結

來源:互聯網
上載者:User

標籤:

本文主要總結了關於Mysql中索引的操作,主要涉及索引的查看,增加和刪除。

1. 查看索引

http://dev.mysql.com/doc/refman/5.7/en/show-index.html

SHOW {INDEX | INDEXES | KEYS} {FROM | IN} tbl_name [{FROM | IN} db_name] [WHERE expr]
2. 插入索引

http://dev.mysql.com/doc/refman/5.7/en/create-index.html

CREATE [UNIQUE|FULLTEXT|SPATIAL] INDEX index_name    [index_type]    ON tbl_name (index_col_name,...)    [index_option]     [algorithm_option | lock_option] ...index_col_name:    col_name [(length)] [ASC | DESC]index_type:    USING {BTREE | HASH}index_option:    KEY_BLOCK_SIZE [=] value  | index_type  | WITH PARSER parser_name  | COMMENT ‘string‘algorithm_option:    ALGORITHM [=] {DEFAULT|INPLACE|COPY}lock_option:    LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}
3. 刪除索引

http://dev.mysql.com/doc/refman/5.7/en/drop-index.html

DROP INDEX index_name ON tbl_name    [algorithm_option | lock_option] ...algorithm_option:    ALGORITHM [=] {DEFAULT|INPLACE|COPY}lock_option:    LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}

 

MySQL 索引操作總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.