Subject | Re: choosing best index |
---|---|
Author | p_lerner |
Post date | 2003-09-02T17:46:03Z |
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:
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:index
>
> >Hi, where can I find information about how to choose the best
> >for a query ?(e.g.
> >
> 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
> uniqueness) for creating a compound index.