1. Prefix index
The prefix index is used to solve the problem that when some long strings and some large text fields are indexed in the entire field, the index volume is too large, which causes a lot of waste of disk IO. Using a prefix index can reduce the volume of the index and improve the efficiency of the index.
When creating an index for a large text or a relatively long string, using a prefix index can reduce the size of the index and improve query efficiency.
Create an index for the first five characters of the Email field
create index idx_email_5 on tb_user(email(5));