9.sql execution efficiency analysis

Question: If you find that some SQL execution is slow, how to find out them?

Insert picture description here
Insert picture description here

As long as the specified time is exceeded, an exception will occur
Insert picture description here

Explain keyword can view the efficiency of sql execution

Insert picture description here
Insert picture description here
Insert picture description here

Create index
create index index name on table name (field name)
CREATE unique INDEX id_user_namess on user(NAME)

B+Tree is used as the index structure, and the data field of the leaf node stores the address of the data record

Guess you like

Origin blog.csdn.net/zyf_fly66/article/details/113943098