Subject | Re: [firebird-support] '<>' doesn't pick the index in the where clause |
---|---|
Author | Milan Babuskov |
Post date | 2004-11-10T07:09:17Z |
william_yuwei wrote:
has to go throught entire table anyway. My guess is that the version
that uses index works slower.
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org
> The following SQL doesn't use the index:Think about it: If you're going to select *all* records but one, then it
>
> SELECT * FROM CLIENTS
> WHERE CLIENT_ID <> 1
>
> but the one below use the correct index:
>
> SELECT * FROM CLIENTS
> WHERE CLIENT_ID > 1 OR CLIENT_ID < 1
>
> How come? BTW, I'm using DB WorkBench to see the sql plans.
has to go throught entire table anyway. My guess is that the version
that uses index works slower.
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org