1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: Lockless DB design  (was Fw: lurker emerges) -->
<!--X-From-R13: X Q Znjerapr <pynjNhaqre.rate.ftv.pbz> -->
<!--X-Date: Wed, 16 Sep 1998 17:11:32 &#45;0700 -->
<!--X-Message-Id: 199809170011.RAA07338#under,engr.sgi.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 005201bdc3a8$8420b520$961e5d18#default,rochester.rr.com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: Lockless DB design  (was Fw: lurker emerges)</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:claw#under,engr.sgi.com">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg01051.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01053.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00583.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00578.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#01052">Author</A>
&nbsp;|&nbsp;<A HREF="#01052">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#01052">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: Lockless DB design  (was Fw: lurker emerges)</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Re: Lockless DB design  (was Fw: lurker emerges)</LI>
<LI><em>From</em>: J C Lawrence &lt;<A HREF="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</A>&gt;</LI>
<LI><em>Date</em>: Wed, 16 Sep 1998 17:11:15 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Sun, 9 Aug 1998 11:15:14 -0400 
James Wilson&lt;jwilson#rochester,rr.com&gt; wrote:

&gt; 1. if one obtains an object which contains a reference to another,
&gt; and then obtains the referent, does this require two DB hits? If
&gt; so, perhaps a prefetching strategy could be used: requesting
&gt; object foo gets you foo together with everything it points to (but
&gt; nothing beyond that). This could be a loss if the larger set
&gt; incurs extra collisions with other threads to the extent that any
&gt; gains from prefetching are swamped.

There are two problems here that appear to be being hidden:

  1) Physical IO is slow and needs to be minimised.

  2) DB accesses from the DB cache need to be fast.

Prefetching as you describe stuffs the cache with records such that
later accesses may be faster (taking advantage of the performance
gain of #2 over #1).  However, unless accessing all those records at 
once is faster than accessing them each individually, you are not
going to gain anything and are in fact likely to lose due to the
fact that some (large?) percentage of those objects won't be
accessed and you will have spent expensive physical IO time loading
them when they are unneeded.  

Its a trade-off.  Depending on your DB structure and call tree
overhead it may be a lot faster to do something like:

  load_records (#,#,#,#,#,#);

than:

  load_record (#);
  load_record (#);
  load_record (#);
  load_record (#);
  load_record (#);
  load_record (#);

and the fact that some percentage of those loads are in fact useless
is saved by the general performance gain of the first over the
second.  Measure.  Choose.

&gt; 2. how can one use this system to guarantee correctness when
&gt; dealing with compound objects? 

I believe this was already answered by other posts.  No?  Briefly
this is a question of "nested transactions" to put it into DB
parlance.  You can't have child transactions compete for C&amp;C without
critically endangering logical correctness.  You have to have child
transactions be subsumed by their parents.

&gt; This would be a race condition (or a "dragon's door", as it has
&gt; been termed here). 

"Dragon's Dinner" actually.  &lt;shrug&gt;   Many of the list members don't
have CS backgrounds, so it provides a very simple and easily
understood example of the basic problem.  (Thanks DEMOS!)

-- 
J C Lawrence                               Internet: claw#null,net
(Contractor)                               Internet: coder#ibm,net
---------(*)                     Internet: claw#under,engr.sgi.com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00582" HREF="msg00582.html">[MUD-Dev] Fw: lurker emerges</A></STRONG>
<UL><LI><EM>From:</EM> "James Wilson" &lt;jwilson#rochester,rr.com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg01051.html">[MUD-Dev] Re: The great crusade....</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg01053.html">[MUD-Dev] Re: lurker emerges</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00583.html">[MUD-Dev] Re: Fw: lurker emerges</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00578.html">[MUD-Dev] Re: Adverts in email on the list.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#01052"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#01052"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>[MUD-Dev] Re: lurker emerges</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="01058" HREF="msg01058.html">[MUD-Dev] Re: lurker emerges</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 17 Sep 1998, 02:19 GMT
<UL>
<LI><strong><A NAME="01059" HREF="msg01059.html">[MUD-Dev] Re: lurker emerges</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Thu 17 Sep 1998, 06:32 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
<LI><strong><A NAME="00582" HREF="msg00582.html">[MUD-Dev] Fw: lurker emerges</A></strong>, 
James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Sun 09 Aug 1998, 15:26 GMT
<UL>
<LI><strong><A NAME="00583" HREF="msg00583.html">[MUD-Dev] Re: Fw: lurker emerges</A></strong>, 
T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Sun 09 Aug 1998, 15:57 GMT
</LI>
<LI><strong><A NAME="01052" HREF="msg01052.html">[MUD-Dev] Re: Lockless DB design  (was Fw: lurker emerges)</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 17 Sep 1998, 00:11 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00578" HREF="msg00578.html">[MUD-Dev] Re: Adverts in email on the list.</A></strong>, 
quzah <a href="mailto:quzah#geocities,com">quzah#geocities,com</a>, Sun 09 Aug 1998, 08:39 GMT
<UL>
<LI><strong><A NAME="00594" HREF="msg00594.html">[MUD-Dev] Re: Adverts in email on the list.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 09 Aug 1998, 19:47 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00585" HREF="msg00585.html">[MUD-Dev] Re: Adverts in email on the list.</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 09 Aug 1998, 16:15 GMT
</LI>
<LI><strong><A NAME="00617" HREF="msg00617.html">[MUD-Dev] Re: Adverts in email on the list.</A></strong>, 
quzah <a href="mailto:quzah#geocities,com">quzah#geocities,com</a>, Mon 10 Aug 1998, 09:02 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>