Subject Re: [firebird-support] Primary Keys / Indexes
Author Martijn Tonies
Hi,

> My understanding of how Firebird uses Primary keys and indexes are below.
> If there is a Primary Key or Index available, the Optimizer will use it.
>
> I come from an AS400 environment. The programmer chooses the index
> (logical) to be used not the database. How does the optimizer choose,
> and what types of problems arise from that situation?

Well, sometimes, the optimizer makes mistakes.

But in general, I would say that having a separate optimizer, that
keeps track of the current data changes (eg: index selectivity)
beats the hell out of doing navigational access yourself.

IMO, selecting the indices yourself is "not done" and the systems
with an optimizer are superior.

>Can I choose
> the index to be used rather than the optimizer?

Yes, but you really shouldn't.

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