MySQL index creation syntax, mysql index creation

Source: Internet
Author: User

MySQL index creation syntax, mysql index creation

1. Introduction:

All mysql index column types can be indexed. Using indexes for related classes can improve the performance of select queries.Mysql IndexNumber, which can be the maximum index and the minimum index. Each storage engine supports at least 16 indexes for each table. The index length is 256 bytes.

By default, indexes created for tables of mysim and innodb Storage engine are both btree indexes. Currently, mysql does not support function indexes, but supports leading-edge indexes. It specifies the first N characters of a field.Create an index

2. mysql index creation syntax

CREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name
[Index_type]
ON tbl_name (index_col_name ,...)
[Index_type]

------

Index_col_name:
Col_name [(length)] [ASC | DESC]

Index_type:
USING {BTREE | HASH | RTREE}

Note: If you make a mistake when creating an index, You need to modify the mysql index. We can use alert to modify the index.Create indexWe will not talk about it. You can check the relevant manual.

3. Index deletion Syntax:

Drop indexname on tablename

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.