So whenever I EXPLAIN my query, I often get instances in which it states certain fields as possible keys but then the key table will be null…
Why would MySQL do this and decide to use no keys when in fact it can use a possible key?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It can’t always use a key, for instance:
Although
idis a possible key for both lookups, it can’t be used for both. One of the tables must do a full scan.