<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Michael/Alex, <br>
<br>
Can you comment on Mike Owen's observations and questions below? <br>
<br>
Thanks, <br>
<br>
Dave<br>
<br>
On 3/20/2010 8:01 PM, Mike Owens wrote:
<blockquote
cite="mid:df2316bd1003202001x15011712h9c8bba957b2fb317@mail.gmail.com"
type="cite">I should have the article ready by next Monday 29th. I've
got my test code together and have some things that I am not quite
clear on. <br>
<br>
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.<br>
<br>
I see some comments in sql/adaptor/btree.c that suggest that perhaps
the numbers don't mean the same things:<br>
<br>
/*<br>
** Change the way data is synced to disk in order to increase or
decrease how<br>
** well the database resists damage due to OS crashes and power
failures.<br>
** Level 1 is the same as asynchronous (no syncs() occur and there is a
high<br>
** probability of damage) Level 2 is the default. There is a very low
but<br>
** non-zero probability of damage. Level 3 reduces the probability of
damage<br>
** to near zero but with a write performance reduction.<br>
**<br>
** Berkeley DB always does the equivalent of "fullSync".<br>
*/<br>
int sqlite3BtreeSetSafetyLevel(Btree *p, int level, int fullSync)<br>
{<br>
BtShared *pBt;<br>
log_msg(LOG_VERBOSE,<br>
"sqlite3BtreeSetSafetyLevel(%p, %u, %u)", p, level, fullSync);<br>
<br>
pBt = p->pBt;<br>
if (GET_DURABLE(p->pBt)) {<br>
pDbEnv->set_flags(pDbEnv, DB_TXN_NOSYNC, (level == 1));<br>
pDbEnv->set_flags(pDbEnv, DB_TXN_WRITE_NOSYNC, (level == 2));<br>
}<br>
return SQLITE_OK;<br>
}<br>
<br>
For SQLite levels, 0=OFF, 1=NORMAL, 2=FULL (there is no 3).<br>
<br>
In the code above, it seems that 1=OFF and 2=NORMAL and I don't see any
code that sets FULL (unless this is 3 in BDB and equates to the default
"fullSync").<br>
<br>
The BDB code that parses this PRAGMA is identical to SQLite's (in
sqlite/src/pragma.c which both code bases share identically) in that it
associates whatever integer value is passed in through SQL is
associated with the DB/btree.<br>
<br>
The problem here is that if this is true, then BDB's values are
different from SQLite's. And if a programmer were going for SQLite's
synchronous value of 1, it would mean that the sme code running against
BDB would not be durable (nosyncs) -- something they would not expect.<br>
<br>
Can you confirm this for me?<br>
<br>
If this is true, then perhaps the above code should be (in part)<br>
<br>
if (GET_DURABLE(p->pBt)) {<br>
pDbEnv->set_flags(pDbEnv, DB_TXN_NOSYNC, (level == 0));<br>
pDbEnv->set_flags(pDbEnv, DB_TXN_WRITE_NOSYNC, (level == 1));<br>
}<br>
<br>
And at least 0 and 1 would match up with SQLite. Still not sure about 2
(unless again it maps to BDB's level which is default fullSync).<br>
<br>
Thanks,<br>
<br>
Mike<br>
<br>
<div class="gmail_quote">On Fri, Mar 19, 2010 at 1:54 PM, Dave
Segleau <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:dave.segleau@oracle.com">dave.segleau@oracle.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Hello Mike,<br>
<br>
Thank you very much for the quote earlier this week. <br>
<br>
I wanted to let you know that the final Beta Release snapshot is
now available here:<br>
<br>
<span><a moz-do-not-send="true"
href="http://download.oracle.com/otn/beta/bdb/db-5.0.13.zip"
target="_blank">http://download.oracle.com/otn/beta/bdb/db-5.0.13.zip</a></span><br>
<span><a moz-do-not-send="true"
href="http://download.oracle.com/otn/beta/bdb/db-5.0.13.tar.gz"
target="_blank">http://download.oracle.com/otn/beta/bdb/db-5.0.13.tar.gz</a><br>
<br>
This is the last planned Berkeley DB 11gR2 beta snapshot. This snapshot
contains bug fixes, documentation updates and a cleaned up build
process. We're on
target for a production release on March 31st. Please provide any
feedback or major issues by end of day, Monday March 22nd. <br>
<br>
I'm looking forward to seeing your article. When do to you think that
you'll have a draft. <br>
<br>
Also, I'm working with Jonathan to get OSCON on "marketing program"
map. Is there anyone at OSCON that I can speak with to get an
understanding of typical attendance and profile of the attendees? <br>
<br>
Thank you very much for your participation in the Beta program. Your
evaluation and feedback about the product is very valuable to us. <br>
<br>
Regards, <br>
<font color="#888888"><br>
Dave</font></span><br>
</div>
</blockquote>
</div>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<a href="http://www.oracle.com" target="_blank"><img
src="cid:part1.09020001.01000601@oracle.com" alt="Oracle" width="114"
border="0" height="26"></a><br>
<font color="#666666" face="Verdana, Arial, Helvetica, sans-serif"
size="2">David Segleau | Director Product Management - Berkeley DB<br>
Phone: +1 425 945 8533 | Mobile: +1 408 420 7350 <br>
<font color="#ff0000">Oracle</font> Database Engineering<br>
</font><br>
<a href="http://www.oracle.com/commitment" target="_blank"><img
src="cid:part2.00070300.03050405@oracle.com" alt="Green Oracle"
width="44" align="abscenter" border="0" height="28"></a>
<font color="#4b7d42" face="Verdana, Arial, Helvetica, sans-serif"
size="1">Oracle is committed to developing practices and products that
help protect the environment</font>
<!-- This signature was generated by the MyDesktop Oracle Business Signature utility version 3.5.7 --></div>
</body>
</html>