Composite Index Failure Situation

  1. all invalid

The principle of leftmost matching is not followed: the first column is not used or the first column is operated in the following 6 cases

  1. Manipulating Index Columns

Function operations or other calculation operations are performed on the composite index columns, and the operated columns and subsequent columns cause partial or complete failure of the index

  1. Use ! or <> or is not null for the index column (is null takes the index)

Perform this operation on the composite index column, and the operated column and subsequent columns will cause part or all of the index to fail

  1. Use range query

Perform this operation on the composite index column, and the operated column and subsequent columns will cause part or all of the index to fail

  1. When indexing column like, % is written in front of the query condition; for example: %abc

Perform this operation on the composite index column, and the operated column and subsequent columns will cause part or all of the index to fail

  1. Use data type conversion

Perform this operation on the composite index column, and the operated column and subsequent columns will cause part or all of the index to fail

  1. Action column break

Perform this operation on the composite index column, and the operated column and subsequent columns will cause part or all of the index to fail

Guess you like

Origin blog.csdn.net/zq17665014809/article/details/127297920