Subject Re: choosing best index
Author p_lerner
I know about the optimizer. But I was wondering if composite indexes
is usefull for a multiexpression "where" clause:

select * from A,B
where A.b_id = B.b_id
and A.b_id = value1
and A.f2 = value2
and b.f2 = value3

how wold you index table A to optimize this query ?

a) A.b_id,A.f2 (composite)?
b) A.f2,A.b_id (composite)?
c) A.b_id and A.f2 (individually)?


--- In firebird-support@yahoogroups.com, Ann Harrison
<aharrison@i...> wrote:
> p_lerner wrote:
>
> >Hi, where can I find information about how to choose the best
index
> >for a query ?
> >
> Errr... that's sort of what the optimizer is for.
>
> >Is it faster to index each field or to make composite indexes
> >according to the query ?
> >
> >
> Probably index each field unless there is some compelling reason
(e.g.
> uniqueness) for creating a compound index.