Subject | Re: Rif: [firebird-support] Re: Is it possible to use only "part" of the index? |
---|---|
Author | Mark Rotteveel |
Post date | 2015-07-20T13:56:48Z |
On 20 Jul 2015 05:20:31 -0700, "brucedickinson@... [firebird-support]"
<firebird-support@yahoogroups.com> wrote:
<value of ID_MASTER><value of ID_PARAM>
This means that when you only want to find ID_PARAM, then the index cannot
be used, because Firebird would have to scan the whole index. If you
reverse the order of the fields, you get
<value of ID_PARAM><value of ID_MASTER>
This means that it can quickly identify the fields with ID_PARAM (a prefix
match on the entire index entry).
Mark
<firebird-support@yahoogroups.com> wrote:
> So, if I change the order of fields in the index I can speed things up.internals
> Could someone explain me why it works like it works? What are the
> behind this?Simplified the index entry is
<value of ID_MASTER><value of ID_PARAM>
This means that when you only want to find ID_PARAM, then the index cannot
be used, because Firebird would have to scan the whole index. If you
reverse the order of the fields, you get
<value of ID_PARAM><value of ID_MASTER>
This means that it can quickly identify the fields with ID_PARAM (a prefix
match on the entire index entry).
Mark