Subject Re: [firebird-support] Re: where field = any
Author Alexandre Benson Smith
Miroslav Penchev wrote:

>On Thu, 21 Oct 2004 10:06:24 +0800, James <james_027@...> wrote:
>
>
>
>>Hi Miroslav,
>>
>>You got a nice answer here, but concerning on what svein erling posted,
>>if I had 1=0 will this scan the whole table and slow down the whole
>>thing?
>>
>>
>
>I don't thing so. I thing that query optimizer will see that
>1=:ACTIVE_FILTER when ACTIVE_FILTER is 0 is always false and will not scan
>any record for that.
>
>Cheers,
>
>
No, AFAIK the optimizer doesn't compute "constants" expression before
execute the statement, it will be evaluated for each row. If it does it
the trick to put an "or something" to force optimizer ignore the bad
indices will not work. :-)

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br