> Vladislav Vaintroub wrote:
> Kevin, nulls are used by optimizer, and they are not *that* undeterministic.
>
> In a query like
> select * from t where a is NULL;
> if a is indexed or and if you have multisegment index where a is the first
> member, optimizer will ask you for NULL.
The MySQL optimizer is counting on the fact that NULLs occur in the sort
order before real values. That is OK to set that requirement on MySQL
storage engines.
> Also this condition (a = 1 and b < 0 and c=1), that seemingly has nothing
> to do with NULLs, will be translated into range query lower=(1,NULL,1)
> upper=(1,0,1) by optimizer , if there is (a,b,c) index.
That aught to work, if we were to sort our NULL values before all real
values, even negative values. But we seem to sort our NULLs with our
zeros when there is a nultisegment key.