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?