What does the filtered EXPLAIN query column mean in MySQL?

mysql> EXPLAIN EXTENDED SELECT * FROM table WHERE column = 1 LIMIT 10;
+----+-------------+----------+------+---------------+--------------+---------+-------+--------+----------+-------+
| id | select_type | table    | type | possible_keys | key          | key_len | ref   | rows   | filtered | Extra |
+----+-------------+----------+------+---------------+--------------+---------+-------+--------+----------+-------+
|  1 | SIMPLE      | table    | ref  | column        | column       | 1       | const | 341878 |   100.00 |       |
+----+-------------+----------+------+---------------+--------------+---------+-------+--------+----------+-------+
1 row in set, 1 warning (0.00 sec)

What does a filtered column mean and should it be high or low? Yes, I read the documents, but I do not quite understand what the number indicates or what values ​​are considered desirable.

+3
source share
1 answer

A column filteredis an estimated percentage that indicates the number of rows that will be joined to the previous table. In your case 100%, that is , i.e. All lines.

rows, as you apparently know, is an estimate of the number of rows considered in the query, so it rows x filtered / 100will be the number of connections that should be made (the number of rows left after applying the table).

. MySQL Optimizer - MySQL Query Optimizer ( 10).

EDIT:

High performance MySQL (2- ) , , (filtered) ALL, index, range index_merge.

+5

Source: https://habr.com/ru/post/1752351/


All Articles