MySQL Internals Manual  /  ...  /  NOT (<>) Relations

7.2.3.4 NOT (<>) Relations

It is a logical rule that

column1 <> 5 

is the same as

column1 < 5 OR column1 > 5 

However, MySQL does not transform in this circumstance. If you think that a range search would be better, then you should do your own transforming in such cases.

It is also a logical rule that

WHERE NOT (column1 != 5) 

is the same as

WHERE column1 = 5 

However, MySQL does not transform in this circumstance either.

We expect to add optimizations for both the previous cases.


User Comments
Sign Up Login You must be logged in to post a comment.