Subject | Re: [firebird-support] Query optimization |
---|---|
Author | Kjell Rilbe |
Post date | 2005-02-21T12:34:18Z |
Arno Brinkman wrote:
including additional fields in an index - it won't add any information.
Not for the purpose of this kind of query anyway.
Thanks for clearing the mist in front of my eyes! :-)
Kjell
--
--------------------------------------
Kjell Rilbe
Adressmarknaden AM AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
>>This is the plan with your suggested modification of the query:Ah! I see! Of course, since the first field is a PK, there's no point
>>PLAN JOIN (A INDEX (A_Status,A_Status),
>>F INDEX (F_PK,F_PK))
>>
>>I would have expected something like this:
>>PLAN JOIN (A INDEX (A_Status,A_Status),
>>F INDEX (F_PK_STATUS,F_PK_STATUS))
>>where F_ID_STATUS is the index you said I should create. (Note that you
>>mixed up FK/PK on F in your reply.)
>
> When the optimizer can use a PK (full matched !) then this is already the best
> match to make and thus ignores other indexes. Indeed i didn't saw that it was a
> PK for F, but in above query the optmizer makes the right decision.
including additional fields in an index - it won't add any information.
Not for the purpose of this kind of query anyway.
Thanks for clearing the mist in front of my eyes! :-)
Kjell
--
--------------------------------------
Kjell Rilbe
Adressmarknaden AM AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64