Derby is fast and efficient, but when tables are huge, scanning tables might take longer than a user would expect. It's even worse if you then ask Derby to sort this data.
Things that you can do to avoid table scans fall into two categories.
Scripting on this page tracks web page traffic, but does not change the content in any way.