MySQL database-index of query optimization

Source: Internet
Author: User
Tags mysql index

Definition: A data structure that is specifically designed to help users quickly query data in a database. Similar to a directory in a dictionary, you can find the contents of the dictionary based on the directory to locate the data, and then get directly.

Categories: General index, uniqueness Index, full-text index, single-column index, multicolumn Index, spatial index, primary key index, combined index.

Create:

#对表增加普通索引或UNIQUE索引, the () content represents optional.
CREATE (UNIQUE)INDEX on table_name (COL01,COL02);
#用来创建普通索引, unique index, or primary key index ALTER TABLE ADD INDEX index_name (col01,col02); ALTER TABLE ADD UNIQUE (COL01,COL02); ALTER TABLE ADD PRIMARY KEY (COL01,COL02);

Reference: MySQL Index Detailed: http://blog.csdn.net/liaodehong/article/details/52190223

  

MySQL database-index of query optimization

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.