Use SQL prompt

Use SQL prompt

SQL hints are an important means of optimizing the database. Simply put, it is to add some artificial hints to the SQL statement to achieve the purpose of optimizing the operation.


USE INDEX

After the table name in the query statement, add use index to provide a list of indexes that you want MySQL to refer to , so that MySQL no longer considers other available indexes.



IGNORE INDEX

If users simply want MySQL to ignore one or more indexes, they can use ignore index as a hint



FORCE INDEX

To force MySQL to use a specific index, you can use force index as a hint in the query

Guess you like

Origin blog.csdn.net/qq_39368007/article/details/114701026