Subject Re: [ib-support] Re: Indexs!
Author Marcin Bury
Hi all

i've run into some problems with optimizer using 'Less selective first'
rule.

I have a table

mgp_reels

srv varchar(3)
id integer
code varchar(10)
ifra_code varchar(16)

srv is the field for specifying branches

I have primary key set to srv,id
I have another index srv, ifra_code

when I make simple select:

select srv, id, code from mgp_reels where srv = :srv and id = :id

guess what index will be taken by optimizer - the second one - optimizer
forgot about the primary key.
I had to switch columns in indexes to make optimizer think better. Ok there
was another solution - use PLAN in every select.

Marcin