Uday
Uday

Reputation: 1490

What does it mean by the value under 'filtered' column in EXPLAIN EXTENDED of a Mysql SELECT

what does it mean to us when the filtered column in EXPLAIN EXTENDED shows 100%.

What is the difference between the below two situations...?

  1. filtered = 100% in query 1 for column X
  2. filtered = 10% in query 2 for column Y

What is the optimal value for filtered column in EXPLAIN EXTENDED....?

Thanks in advance

Upvotes: 0

Views: 1392

Answers (1)

David Schmitt
David Schmitt

Reputation: 59346

The filtered column is described in the MySQL manual:

The filtered column indicates an estimated percentage of table rows that will be filtered by the table condition. That is, rows shows the estimated number of rows examined and rows × filtered / 100 shows the number of rows that will be joined with previous tables. This column is displayed if you use EXPLAIN EXTENDED. (New in MySQL 5.1.12)

Having 100% there means that most/all rows from this table are filtered by the conditions in the query. In some sense higher values are "better", since that means that the executor does not have to read as much data from the table.

Upvotes: 2

Related Questions