We were looking our Berkeley environment and I noticed that we have DatabaseConfig.setSortedDuplicates( true ) on all of the databases in the environment even the ones that should never have duplicates. Does anybody know what the read performance hit will be, if any, for a database that doesn't have duplicates?
It's surprising that you're getting the behaviour you want, when configuring duplicates accidentally. For example, put() will overwrite the value with the given key without configuring dups, but will not overwrite (will insert a duplicate) when dups are configured.
Note that you cannot have a secondary DB for a primary DB, if that primary DB has dups configured.
The performance question is hard to answer. It depends on the size of the keys and the data, and to be honest we've never made a series of measurements to compare the two.