91 "Ali Baba java development manual" Statute on MySQL (index Statute)

[Mandatory]

  1, the field having a unique operational characteristic, even when a combination of a plurality of fields, it must be built a unique index .

  2, more than three tables prohibit the Join . Need to join the field, data types must be absolutely consistent; when the multi-table associated with the query, ensure that fields are associated with the need to have an index.

  3, on the indexing varchar field, index must be specified length, is not necessary for the whole field index, determined according to the actual text index length discrimination.

    Description: the length of the discrimination index is a contradiction, the general type of string data length of the index 20, the discrimination will be more than 90%, can count (distinct left (column name, index length)) / count (*) is determined based discrimination.

  4, page search is strictly prohibited left vague or fuzzy whole , if needed to be resolved through a search engine.

    Description: B + Tree index file has the most left-prefix matching characteristics, if the left value is not determined, it can not use this index.

[More] recommendation and reference to be

Guess you like

Origin www.cnblogs.com/xiaonengxiong/p/11068923.html