Mysql: impossible where noticed after reading const tables

前端 未结 2 928
南方客
南方客 2021-01-22 15:33

i have one query:

SELECT l.id, title 
FROM (SELECT id 
      FROM news 
      WHERE (title LIKE \'%football predictions argentina%\' OR text LIKE \'%football pre         


        
相关标签:
2条回答
  • 2021-01-22 15:52

    In addition to Shadow's answer, MySQL's explain will show:
    Impossible WHERE noticed after reading const tables
    when a where condition on a non-indexed field is not matched along with a matched where condition on an indexed field.

    It will show
    no matching row in const table
    when a where condition on an indexed field is not matched.

    0 讨论(0)
  • 2021-01-22 16:05

    "impossible where noticed after reading const tables" is bit confusing message. It basically means that one of your where criteria did not match any records, therefore the MySQL optimiser could not (did not want to...) proceed with analysing the query further. It just simply returns an empty resultset.

    Fix is very simple: make sure you test the explain with such where clauses that do return resultset.

    MySQL has an open feature request asking to change the message to a more meaningful one, but I do not think they ever have bothered.

    0 讨论(0)
提交回复
热议问题