What is the "SELECT COUNT(*) FROM xz WHERE xz.a > value" equivalent for berkeleydb je. http://www.oracle.com/technetwork/database/berkeleydb/performing.pdf lists most of the queries I need. But this one is missing.
Currently I found a way by using the Collections API. EntityIndex.sortedMap().tailMap(key).size() to be specific. But that has limitations/problems:
- size can not be larger that Integer.MAX_VALUE which is a problem if you use anything larger than int as index key
- http:// download.oracle.com/docs/cd/E17277_02/html/java/com/sleepycat/collections/StoredContainer.html#size() reads to me that counting is not isolated by the current transaction. There will be many concurrent changes to the index and the relative position of each object in that index is compared to others. That comparison needs to be accurate since the payment model is based on that.
Currently I evaluate berkeleydb je-4.1.6/DPL.