On 09/02/2021 17:17, Bryan Pendleton wrote:
I think Rick was suggesting that if you got the right query plan,
using your index as efficiently as possible, then that would be the
best solution? You can find a lot of information about this in
http://db.apache.org/derby/docs/10.15/tuning/
Perhaps your statistics are inaccurate, so Derby is not choosing the
index-based plan? I think there are ways to force Derby to choose that
plan, and there are also ways to ensure that your statistics are
accurate.
Specifically, see:
http://db.apache.org/derby/docs/10.15/tuning/ctunperfstatistics.html
Great, thanks. I'll look into that asap. Like I said, the user can
choose to sort the results on any column, but 99.99% of the time it just
needs to be sorted into descending time order. If I can speed that one
case up, and also knock the memory usage down by avoiding having to
materialise the whole table, I'll be happy.
--
John English