Subject Re: [firebird-support] Indexing Questions
Author Ann W. Harrison
Anthony Tanas wrote:
>
> I believe I should index APPOINTMENTDATE *descending*, since I generally
> access more future dates then past dates. Am I correct?
>

No. Finding the last entry in an index is (almost) as fast as finding
the first. You start at the top of the index and find an entry on that
page that tells you what page to read next, based on the value. You
read that page and it tells you what page to read next. In a normal
three-level index, that next page would tell you what record you want.
The "almost" qualification comes in because to get to the last record,
you have to read all of the top page, all of the second level page,
and all of the third level page. But that's pretty cheap.


Regards,


Ann