Subject | Re: Primary/Foreign Key Constraints and Indexing - to do, or not to do |
---|---|
Author | Adam |
Post date | 2006-05-22T11:54:29Z |
--- In firebird-support@yahoogroups.com, "Photios Loupis (4T)"
<loupisp@...> wrote:
Primary Key, Foreign Key and Unique constraint fields automatically
create an ascending index in your database.
Adding another index:
* uses space (waste)
* requires time to maintain (more waste)
* can potentially confuse the optimiser
The only possible exception would be if you wanted a descending index
on such a field, that is OK. But otherwise you do not want to do that.
Adam
<loupisp@...> wrote:
>No, don't do it.
>
> Please could someone advise whether it is necessary/advisable or not
> to create separate indices for each Primary or Foreign key contraint
> fields?
Primary Key, Foreign Key and Unique constraint fields automatically
create an ascending index in your database.
Adding another index:
* uses space (waste)
* requires time to maintain (more waste)
* can potentially confuse the optimiser
The only possible exception would be if you wanted a descending index
on such a field, that is OK. But otherwise you do not want to do that.
Adam