Expression 'where bool_field IS true | false' should also use index as 'where
bool_field = true | false' (if such index exists)
-------------------------------------------------------------------------------------------------------------------------------
Key: CORE-4735
URL: http://tracker.firebirdsql.org/browse/CORE-4735
Project: Firebird Core
Issue Type: Improvement
Reporter: Pavel Zotov
Priority: Minor
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel