IS [NOT] NULL meddles with the indexes of SQL statements in Oracle, is there any way I can replace IS NULL in an SQL statement?
According to Oracle 9i Performance Tuning Tips and Techniques, having IS [NOT] NULL suppresses the indexes of the columns.
For example:
select * from users where user_id is not null;
There is no efficient way to do the same thing without changing the data.
You can use a magic value instead of null, for example -1. That would allow you to make the field non-nullable, which increases performance somewhat, and works better with indexes. However, this conflicts with the usual recommendation to avoid magic values, so it’s a compromise between performance and best practice.