java stepped pit daily - Failure Database Index

The most common failure scenarios several indexes, roughly the following:

1, String Data Direct Access using int

2, where like '% a' of

3, the combination index a, b a b alone

4, too much data to hit full table scan

5, there is a column index using a function calculation or

6, a = 'x' or b = 'y', but this time the index has a non-indexed b

 

Recent experience should belong to a special case of 4 - dba report sql slow investigation, we looked to find an index field, table data about 60W, EXPLAIN see query field in an amount of 9 taking the index, 10 full table scan. Field has distinct value probably around 15w.

After trying to come to no avail, using the show index from the index table view, it is the cardinality found a problem, only 38 .. . Contact dba carried analyze the operation, again explain the problem to solve.

But arguably one of the following two conditions, cardinality value in relation to changes.

  • The data in Table 1/16 has changed
  • stat_modified_counter>2000000000

Doubts about the cause of the problem here.

 

Guess you like

Origin www.cnblogs.com/fbw-gxy/p/11595093.html