Subject | Re: Any advantage of a Compound Index across two already indexed fields? |
---|---|
Author | Adam |
Post date | 2006-05-30T07:33:22Z |
--- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov" <SD@...>
wrote:
I have several options of which tools I can use
create index ix_tablea_1 on tablea (field1);
create index ix_tablea_2 on tablea (field2);
OR
create index ix_tablea_3 on tablea (field1, field2);
Obviously there are queries which the first two indices can help with
that the third can not. My question is, what benefit would there EVER
be in declaring the third index given that you could alternatively
declare ix_tablea_1 and ix_tablea_2 for the same benefit but more
flexibility?
Adam
wrote:
>OK then, in your terms then
> On 30 May 2006 at 6:39, Adam wrote:
>
> >1. Given that Firebird is capable of combining both of those indices,
> >is there any benefit to creating a compound key across them?
>
> Indexes are not a target but a tool. The answer depends on queries
> you perform against the table.
I have several options of which tools I can use
create index ix_tablea_1 on tablea (field1);
create index ix_tablea_2 on tablea (field2);
OR
create index ix_tablea_3 on tablea (field1, field2);
Obviously there are queries which the first two indices can help with
that the third can not. My question is, what benefit would there EVER
be in declaring the third index given that you could alternatively
declare ix_tablea_1 and ix_tablea_2 for the same benefit but more
flexibility?
Adam