Subject | Re: [firebird-support] Re: Need Speed Optimization for SQL |
---|---|
Author | Vishal Tiwari |
Post date | 2015-04-16T08:47:55Z |
I tried dropping that index, but sql execution time is still same i.e. 1.893 seconds.
What do you mean by this, Vishal?
I think it was fixed a while ago, but duplicate indexes used to confuse the optimizer, so PK_DOCUMENT_HEADER ought not to be both the primary key and have a separate single-field index (unless the PK or index is DESCENDING or consists of more than one field) - at best it makes INSERTs marginally slower due to having to maintain two identical indexes.
Set
On Thursday, 16 April 2015 2:15 PM, Vishal Tiwari <vishualsoft@...> wrote:
Sorry SET, but this is an existing database, I understand your point and completely agree with you. Shall I try droping that index then ? What you suggest ?
On Thursday, 16 April 2015 1:35 PM, "Svein Erling Tysvær svein.erling.tysvaer@... [firebird-support]" <firebird-support@yahoogroups.com> wrote:
>CRM_DOCUMENT_HEADER Table - PK_DOCUMENT_HEADER is primary key and having seperate index on this column as well
What do you mean by this, Vishal?
I think it was fixed a while ago, but duplicate indexes used to confuse the optimizer, so PK_DOCUMENT_HEADER ought not to be both the primary key and have a separate single-field index (unless the PK or index is DESCENDING or consists of more than one field) - at best it makes INSERTs marginally slower due to having to maintain two identical indexes.
Set