I have a Berkeley DB JE setup using the DPL.
I have a secondary key field which is a string, and I would like to retrieve all distinct values for this key. No additional fitlering is required, I simply want all the distinct values.
I could iterate over all entries and add values to sets, but this seems very inefficient as I have on the order of 10s of values from hundreds of thousands of rows.
If you just need the distinct keys (not the distinct entities), you can do this by calling SecondaryIndex.keys and then calling EntityCursor.nextNoDup to iterate through the unique values.
I recommend posting questions on Berkeley DB Java Edition to its OTN forum.
--mark