Subject Index question
Author Paul R. Gardner
Say I have an INVOICE table that has an ID field as a primary key. As I
add invoices, a generator gets the next value so the field runs 1 - n.
Should the index be ascending or descending?

I would think descending is the way to go since users would not lookup
old invoices (say over 120 days). Therefore a descending index should
find the invoice I'm trying to lookup faster. After years of data the
old invoices would not be seen often.

On the other hand, since the values go upwards, does the entire index
need to be rewritten if it's descending? (I'm picturing an index that
looks something like 5,4,3,2,1. I add #6 to it. Now it needs to be
6,5,4,3,2,1 which means that it may have had to shift everything and
redo the index. Perhaps I'm picturing this wrong!)

Thanks in advance,
Paul


[Non-text portions of this message have been removed]