[BDB 11gR2 Beta] Berkeley DB 11gR2 Beta release -- Mike Owens [#18275]

Michael Cahill michael.cahill at oracle.com
Sun Mar 21 16:06:35 PDT 2010


Hi Mike,

This was a bug that has been fixed in our tree.  For what it's worth, this was first reported by Richard Hipp about a week ago.

>> I guess the relates to both the article and the tech eval. I can't quite figure out what PRAGMA synchronous means in BDB. This is an important comparison and when I run some benchmarks I get better performance with synchronous=1 than with synchronous=0 in BDB, which is counterintuitive with SQLite.
>> 
>> I see some comments in sql/adaptor/btree.c that suggest that perhaps the numbers don't mean the same things:

The numbers are interpreted in the same way: the confusing thing is that SQLite's pragma.c adds one to the value you see in SQL before the value gets to the btree layer.
 
The issue was simpler: our implementation of SetCacheSize was overriding the "nosync" flag, because SQLite has a concept of sync vs nosync for the cache as well as the journal, where that doesn't make sense for Berkeley DB (cache writes are never synchronous).

So the problem was that you would set nosync (synchonous=0/off in SQL, but 1 by the time it gets to the btree layer).  That would turn on the DB_TXN_NOSYNC flag in Berkeley DB.  However, after that, a call to sqlite3BtreeSetCacheSize would override that setting and turn DB_TXN_NOSYNC off again.  The fix is to just ignore this sync issue for the cache.

I hope this clears things up, and in the next snapshot you should see the expected performance improvement with synchronous=off.

Regards,
Michael Cahill, Oracle Berkeley DB.


More information about the BDB-BETA-FEEDBACK mailing list