You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL> recreate table t(boo boolean);
SQL> commit;
SQL> create index t_boo on t(boo);
SQL> commit;
SQL> set plan on;
SQL> select * from t where boo is null;
PLAN (T INDEX (T_BOO))
SQL> select * from t where boo is not distinct from true;
PLAN (T INDEX (T_BOO))
SQL> select * from t where boo = true;
PLAN (T INDEX (T_BOO))
SQL> select * from t where boo IS true;
PLAN (T NATURAL)
It will be useful if optimizer will also use index in the last expression because for boolean values one may easy to get mistake by typing 'x IS true' instead of 'x = true' -- simply because first case "sounds" more natively in english language when such expression is pronounced.
Submitted by: @pavel-zotov
SQL> recreate table t(boo boolean);
SQL> commit;
SQL> create index t_boo on t(boo);
SQL> commit;
SQL> set plan on;
SQL> select * from t where boo is null;
PLAN (T INDEX (T_BOO))
SQL> select * from t where boo is not distinct from true;
PLAN (T INDEX (T_BOO))
SQL> select * from t where boo = true;
PLAN (T INDEX (T_BOO))
SQL> select * from t where boo IS true;
PLAN (T NATURAL)
It will be useful if optimizer will also use index in the last expression because for boolean values one may easy to get mistake by typing 'x IS true' instead of 'x = true' -- simply because first case "sounds" more natively in english language when such expression is pronounced.
Commits: ba03a8c FirebirdSQL/fbt-repository@e66b0fd
The text was updated successfully, but these errors were encountered: