Subject | Re: how work an index.. |
---|---|
Author | GrumpyRain |
Post date | 2004-11-29T22:39:16Z |
I have tried to understand the question, so sorry if you are asking a
different question.
Firstly, if Field1 is unique and not null, it is a primary key
candidate in its own right. You are right that Firebird indexes are
one directional. My understanding is that this is to minimize the size
of the index. The only drawback I can see is that the index can't help
with a reverse sort, but you can always add a descending index if you
need that functionality.
Sometimes, it may not be obvious to the optimizer which index to use.
Do a search for IBPlanalyzer. That program will show you the query
plan, as well as which tables suffer the most record hits.
Good luck
Adam
different question.
Firstly, if Field1 is unique and not null, it is a primary key
candidate in its own right. You are right that Firebird indexes are
one directional. My understanding is that this is to minimize the size
of the index. The only drawback I can see is that the index can't help
with a reverse sort, but you can always add a descending index if you
need that functionality.
Sometimes, it may not be obvious to the optimizer which index to use.
Do a search for IBPlanalyzer. That program will show you the query
plan, as well as which tables suffer the most record hits.
Good luck
Adam