Subject | Re: [firebird-support] Desactivate usage of a poor selectivity index created by foreign key |
---|---|
Author | Jerome Bouvattier |
Post date | 2004-05-14T10:24:17Z |
Hello Philippe,
do referential integrity related stuff ourselves in triggers.
Can anyone confirm ?
Also, does anyone know whether the following enhancements are planned for
future FB versions ?
- Creating an FK that uses a preexisting index (which could be a compound
one in order to be more selective)
- Creating an FK without any index at all.
Regards.
--
Jerome
> Hello,[..]
> when we create foreign key an index is created, but this index can have a
> very
> weak selectivity and then the plan is not very good
> for example :
> in this example the field STATUS has only 3 différents values
>
>I believe the only way so far, is to drop the FK (along with the index) and
> I know that if I make :
> SELECT * FROM MACHINS WHERE STATUS=1;
> the plan is :
> PLAN (MACHINS INDEX (IDX_FK_STATUS))
>
> and when I make :
> SELECT * FROM MACHINS WHERE STATUS+0=1;
> the plan is (and it is better) :
> PLAN (MACHINS NATURAL)
>
> Is there another way ?
do referential integrity related stuff ourselves in triggers.
Can anyone confirm ?
Also, does anyone know whether the following enhancements are planned for
future FB versions ?
- Creating an FK that uses a preexisting index (which could be a compound
one in order to be more selective)
- Creating an FK without any index at all.
Regards.
--
Jerome