In a relational database, what are the main functions of the index, and what are the general conditions for indexing? And what are the different types of indexes?

Source: Internet
Author: User
Tags ming

Improve query speed, facilitate sorting and grouping. (The process of sorting and grouping, if not indexed, results in temporary tables and filesort)

Based on business logic, analyze the frequency and order of column queries, and build indexes and composite indexes.

Primary key index (primary key),----> No index name is required because there is only one primary key index

Unique index (single key)

---->unique Key Email (email (10))

Inside the parentheses is the table field, the outside index name, the other index

The 10 inside refers to the length of the index, such as [email protected], only take out the first 10 characters to index

Normal index (key),

Full-text index (fulltext key)---> Chinese environment basic Invalid, generally with third-party programs such as Sphinx (Chinese participle)

Multi-column index: Key XM (xing,ming) indexed with Xing and Ming two fields

Redundant indexes: There are multiple indexes on a field, such as key XM (xing,ming), Key M (Ming), and two are redundant indexes

In a relational database, what are the main functions of the index, and what are the general conditions for indexing? And what are the different types of indexes?

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.