Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaozhen Liu committed Aug 18, 2021
1 parent ff5bc24 commit 6f02adb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion choose-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ TiDB uses the following heuristic pre rules to select indexes:

+ rule 4: If only one candidate index is selected based on rule 2 and 3, select this index. If two candidate indexes are separately selected based on rule 2 and 3, select the index with the smaller number of rows to be read (the number of rows with index + the number of rows to be retrieved from a table).

The "unique indexes with full match" in rule 1 means each indexed column has the equivalent qualification. When executing the `EXPLAIN FORMAT = 'verbose' ...` statement, if the pre rules matches an index, TiDB will output a NOTE level warning indicating that the index matches the pre rule.
The "index with full match" in the above rules means each indexed column has the equal condition. When executing the `EXPLAIN FORMAT = 'verbose' ...` statement, if the pre rules matches an index, TiDB will output a NOTE level warning indicating that the index matches the pre rule.

In the following example, because the index `idx_b` meets the condition "unique index + need to retrieve rows from a table" in rule 2, TiDB selects the index `idx_b` as the access path, and `SHOW WARNING` returns a note indicating that the index `idx_b` matches the pre rule.

Expand Down

0 comments on commit 6f02adb

Please sign in to comment.