The function of an index is to query the data in a field after an index is created for a field, which is more efficient, that is, faster,
For example
Create index ABC on Stu (AGE );
If an index is created for the age field of the Stu table, select * from Stu where age> 10 during query;
In this case, the efficiency is high, mainly reflected in the where statement, where age> 10. Age is used as the query condition, and the age is indexed.
The index allows the database program to find the required data without scanning the entire table. That is, when querying, the system first searches for the index and finds the Data Pointer, and then directly locates the data through the pointer, so it is fast.
Disadvantages:
Note that the index query efficiency is high. However, when data is inserted or updated in a table, additional operations are performed to maintain the index. Therefore, other operations are less efficient, it also occupies storage space, and does not create too many indexes. Too many indexes are counterproductive!