Subject | Re: Possible to write this in a way that indices will be used |
---|---|
Author | Doru Ilasi |
Post date | 2008-05-15T18:53:19Z |
Sorry Maya,
Sasha is very right. Glasses won't help me to read more carefully your
select.
What was I suggested to use were usefull if your querry were :
select blah..,
from MyTable D
where ((D.SuplCde = :ISupplierCode) or (D.SuplCde is null))
In your situation it looks like you supply the right querry. If I
remember well, trying to put coalesce in equation will throw the
indices out.
Getting null's out from client or from procedure would not help
either, because you may or may not send a parameter - that is a mean
that a field may or may be not in the querry.
Will wait to see the thread ideas...
Doru
Sasha is very right. Glasses won't help me to read more carefully your
select.
What was I suggested to use were usefull if your querry were :
select blah..,
from MyTable D
where ((D.SuplCde = :ISupplierCode) or (D.SuplCde is null))
In your situation it looks like you supply the right querry. If I
remember well, trying to put coalesce in equation will throw the
indices out.
Getting null's out from client or from procedure would not help
either, because you may or may not send a parameter - that is a mean
that a field may or may be not in the querry.
Will wait to see the thread ideas...
Doru
--- In firebird-support@yahoogroups.com, "Maya Opperman" <maya@...> wrote:
>
> >Doru wrote:>
> >If you are using Firebird 2+ Testing DISTINCTness will be a nice way
> >to go :
> >http://www.firebirdsql.org/manual/nullguide-langelem.html
>
> OK, so ((D.SuplCde = :ISupplierCode) or (:ISupplierCode is null))
>
> would change to ((D.SuplCde is not distinct from :ISupplierCode))
>
> to achieve the same results?
>
> Ie. if D.SuplCde is 'ABC' and ISupplierCode is 'ABC', result will be
> TRUE.
> if D.SuplCde is 'ABC' and ISupplierCode is NULL, result will be
> TRUE??
> if D.SuplCde is 'ABC' and ISupplierCode is 'XYZ', result will be
> FALSE.
>
> Is that right?
>
> Thanks
> Maya
>