Mysql: impossible where noticed after reading const tables

前端 未结 2 927
南方客
南方客 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 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.

提交回复
热议问题