Preface: The Project encountered a problem: write a Web page used to read the background of the data in front of the display, each page is a long time to display the data, and then the where condition of the field to increase the index, the data display speed significantly faster.
index : In a relational database, an index is a single, physical storage structure that sorts the values of one or more columns in a database table, a collection of one or more column values in a table, and a logical pointer list corresponding to the data pages that physically identify those values in the table. The index acts as a catalog of books, and you can quickly find what you need based on the pages in your catalog.
Advantages 1. Greatly accelerate the retrieval speed of data; 2. Create a unique index that guarantees the uniqueness of each row of data in a database table; 3. Accelerates the connection between tables and tables; 4. When you use grouping and sort clauses for data retrieval, you can significantly reduce the time to group and sort in queries. Disadvantage 1. The index needs to occupy physical space. 2. When the data in the table is added, deleted and modified, the index is also maintained dynamically, reducing the maintenance speed of the data. Index: Normal index, unique index, primary key index, aggregate index when creating a table if primary KEY constraints are set to automatically establish a primary key index, the unique constraint automatically creates a single index
Database Interview Series four: index