Subject | Re: [firebird-support] Re: Query tuning help... index with only a few values does wonders... Why? |
---|---|
Author | Arno Brinkman |
Post date | 2003-11-28T08:31:54Z |
Hi,
single index on status (or is it FK ?).
If you put status as FIRST field in the compound index the current engine
could choose this one also for other queries where it may be bad. When using
the status as second field in the index (i assume ID and Type_ID don't have
so much duplicates) the engine cannot use this index unless TypeID or ID is
also available. Note! that FB1 still could be confused with these indices.
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
> here's some advice that I think will make you happy.I would prefer using (ID, Status) or (Type_ID, Status) and indeed drop
>
> Drop BigTable_IDX2, and change BigTable_IDX1 to be on the fields
> (Status, ID) rather than (Status, Type_ID). Then you will get a plan
> like
single index on status (or is it FK ?).
If you put status as FIRST field in the compound index the current engine
could choose this one also for other queries where it may be bad. When using
the status as second field in the index (i assume ID and Type_ID don't have
so much duplicates) the engine cannot use this index unless TypeID or ID is
also available. Note! that FB1 still could be confused with these indices.
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81