Subject | Re: [firebird-support] Primary Keys / Indexes |
---|---|
Author | Martijn Tonies |
Post date | 2006-02-22T15:56:47Z |
> Usually FB tries to find indexes based on fields used in WHERE clauseswidth
> AND. If they are ORed, the optimizer won't look for indexes on thesefields.
That is wrong.
for example:
select *
from ADRES
where RELATIEID = 1
or RELATIEID = 2
where "relatieid" is part of the PK, plan:
PLAN (ADRES INDEX
(RDB$PRIMARY166,RDB$FOREIGN49,RDB$PRIMARY166,RDB$FOREIGN49))
The optimizer is far more complex than this.
Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com