Think about index order

Derby allows you to create index columns in descending order in addition to creating them in ascending order, the default. Descending indexes provide performance benefits for the following kinds of queries that require sorting data in descending order.

To ensure performance benefits, verify that the descending index is being used. See Analyzing statement execution for information on how to do this.

Related concepts
Create useful indexes
Make sure indexes are being used, and rebuild them
Think about join order
Decide whether a descending index would be useful