Subject Re: Rif: [firebird-support] Re: Is it possible to use only "part" of the index?
Author Mark Rotteveel
On 20 Jul 2015 05:20:31 -0700, "brucedickinson@... [firebird-support]"
<firebird-support@yahoogroups.com> wrote:
> So, if I change the order of fields in the index I can speed things up.
> Could someone explain me why it works like it works? What are the
internals
> 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