mysql optimization 2--index optimization

1. When creating a joint index, pay attention to the columns with large dispersion.

able to pass

select count(distinct(A)),count(distinct(B)) from tb;

 

See which column has the largest dispersion.

 

2. Index column check tool - check for duplicate or redundant index columns in mysql index

      pt-duplicate-key-checker:  can detect redundant index columns in the database and give suggestions for deletion;

Execution: Exit mysql, enter the terminal:

pt-duplicate-key-checker -uroot -p1234 -h 127.0.0.1

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326354996&siteId=291194637