I've made a patch that makes EXPLAIN show conditions that are attached to various points of the query plan. If you run EXPLAIN CONDITIONS (or EXPLAIN CONDS) statement, the output besides the usual EXPLAIN resultset will have a second resultset that will show
- Conditions attached to individual tables
- Conditions that are applied before/after join buffering
- Table and index conditions that were pushed down into the storage engine
- ... and so forth (I believe it prints out all possible conditions that are there)
It looks like this:
mysql> explain conds select * from City, Country where City.Country=Country.Code and City.Name like 'C%' and Country.Continent='Asia' and Country.Population>5000000; +----+-------------+---------+------+-------------------+-----------+---------+-----------------+------+------------------------------------+ | id | select_type | table | type | …[Read more]