IS NOT DISTINCT FROM NULL doesn't use index [CORE3722] #1397
Submitted by: @asfernandes
Relate to QA460
Problem happens only with the NULL constant. An expression resulting in NULL works.
create table t (a varchar(5));
select * from t where a is null;
select * from t where a is not distinct from null;
select * from t where a is not distinct from null PLAN (T INDEX (T_A));
select * from t where a is not distinct from nullif('', '');
The text was updated successfully, but these errors were encountered:
Commented by: @dyemanov
Index is neither used for direct comparisons with NULLs, e.g.:
select * from t where a = null;
Obviously, it must return an empty result set, but doing that via the index would be way faster than scanning the whole table.
The issue affects only non-numeric indexed columns.