Answer the question
In order to leave comments, you need to log in
How to speed up SELECT where all rows need to be retrieved except for one?
Good afternoon. I have a wordpress request like this:
SELECT ID, user_login
FROM users
WHERE ID != '81306'
ORDER BY user_login ASC
Answer the question
In order to leave comments, you need to log in
to begin with explain, understand what and how, then look towards composite indexes. The absence of limit is also slightly surprising, in this way you select the entire contents of the table, which cannot but affect the sampling speed. Also, the length of the key for the (obviously) text field (indicate the type by the way, I hope there is a limited varchar, not a longtext or a blob ...) should cover the possible length of the login well.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question