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 kinds of queries that require sorting data in descending order.

See Decide whether a descending index would be useful for some examples.

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