The explain tells that the query is awful (it doesn't use a single key) but I'm using LIMIT 1. Is th

Posted by Ricardo on Stack Overflow See other posts from Stack Overflow or by Ricardo
Published on 2010-05-05T12:10:52Z Indexed on 2010/05/05 12:18 UTC
Read the original article Hit count: 232

Filed under:
|
|
|
|

The explain command with the query:

explain SELECT * FROM leituras 
WHERE categorias_id=75 AND 
textos_id=190304 AND 
cookie='3f203349ce5ad3c67770ebc882927646' AND 
endereco_ip='127.0.0.1' 
LIMIT 1

The result:

id     select_type     table     type     possible_keys     key     key_len     ref     rows     Extra       
1      SIMPLE          leituras  ALL      (null)            (null)  (null)      (null)  1022597  Using where 

Will it make any difference adding some keys on the table? Even that the query will always return only one row.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about query