Subject | Re: [firebird-support] Foreign key like index |
---|---|
Author | Helen Borrie |
Post date | 2008-08-20T12:37Z |
At 22:13 20/08/2008, you wrote:
However, if you have a query that would benefit from a DESCENDING index on the field then it is just fine to create that descending index.
./heLen
>Hi,If you have a foreign key on a field then that field has an ascending index created for it. If I understand this correctly, you are creating another index that duplicates the index on the FK. This does NOT improve performance in any way and, often, it will kill performance, when the optimizer is unable to decide which of two identical indexes to use and uses neither.
>
>I have some cases when I set index on a field which is member of detail
>table but represent connection to a master table like foreign key that
>optimizer use that index for some sql statements. Does firebird work
>better or faster with indexing foreignkey fields in master detail
>scenario, or foreign key is index in same time?
However, if you have a query that would benefit from a DESCENDING index on the field then it is just fine to create that descending index.
./heLen