On 17/06/2020 14:56, Dmitry Yemanov wrote: > > The difference is in the sub-query plan, there's no ConditionalStream > there. So it doesn't make any difference whether <value> is NULL or not, > in both cases index for COLUMN = VALUE is simply not used thus returning > the same result set for the every input record (no index-based > correlation). > > -- original boolean > COLUMN1 = VALUE1 -- using index for COLUMN1 > -- injected boolean > AND COLUMN2 = VALUE2 -- not using index for COLUMN2 > OR COLUMN IS NULL > OR VALUE IS NULL >
Do you think it's safe to check if the stream's column is nullable with getDesc+isNullable and insert the "or column is null" only when it is? Adriano Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel