>>>>> "Robert" == Robert A Bruce <rab@stripped> writes:
Robert> I have a table of about 900,000 customer addresses, and an interactive
Robert> application that can be used to search the addresses, and scroll through
Robert> them in alphabetical order. Scrolling forward is no problem, because it
Robert> is easy and fast to get entries directly following a given value. I can
Robert> get the next 10 values in a twentieth of a second, which is plenty fast
Robert> enough for an interactive application.
Robert> But I cannot scroll backwards. It is very, very slow to get the entries
Robert> that directly precede a value. The following query takes nearly an hour
Robert> to complete:
mysql> select custnum,name from addresses where name < 'Smith;Joe' order by
Robert> name DESC limit 10;
The problem is that MySQL doesn't yet optimise backward-index
optimisation when searching on ranges; This is one the TODO and will
be fixed in the near future.