create table foo (id, name, col1, col2, col3, ..);
create index index_name on foo (col1, col2, col3 desc);
How do I know if it has been created in the descending option and how to verify if queries on foo are really using this index?
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.
You can’t create a multi column index with descending option.
The
DESCis parsed but ignored.From MySQL Docs:
CREATE INDEXsyntax:As for seeing what index is used in queries, you should look into the
EXPLAINstatement which makes it easy to see which indices are used in a particular query.