Re: Concurrency in an RDB

From: David <davidbl_at_iinet.net.au>
Date: 24 Dec 2006 17:39:35 -0800
Message-ID: <1167010775.168932.171670_at_i12g2000cwa.googlegroups.com>


Marshall wrote:
> On Dec 23, 10:49 pm, "David" <davi..._at_iinet.net.au> wrote:
> > Marshall wrote:
> > > David wrote:
> >
> > > > > Sigh. Regardless of the logical data model, a dbms is a formal logic
> > > > > system. The folks who spend money to build databases expect some return
> > > > > for their investment in the form of correct and useful answers.
> >
> > > > That's a good characterisation of an RDB. Not particularly relevant
> > > > to a DB used to store the content for a newspaper.
> >
> > > While I am sore tempted to agree that newspapers run in a logic-free
> > > environment, I cannot.
> >
> > > Why praytell are newspapers not in a position to benefit from
> > > the relational model?
> >
> > I can imagine an extent over the submitted articles being useful, but
> > not using the RM to represent the text itself.
>
> Why not? Certainly that is not the way things are done now,
> but that doesn't really say much.
>
>
> > Out of interest, do you see a benefit in representing a book
> > relationally, assuming it is only comprised of hierarchical chapters of
> > paragraphs of text?
>
> Oh yeah. In a big way.
>
> When I open J. Random Math book, I see that most everything
> in math can be built from a foundation of set theory. I have
> never run across a math book that builds all of mathematics
> out of trees or hierarchies. It seems unlikely given that
> trees cannot express many-to-many relationships.

Agreed

> Your particular example, a list of chapters each of
> which consists of a list of paragraphs, is an example
> of what I call a static hierarchy, which is something
> that the relational model handles particularly well.
>
> And looking at an individual paragraph, what is that?
> It is a string, which is to say a sequence of characters,
> which is a map from the natural numbers to the
> target set characters, which is a relation. How
> would you go about representing the paragraph
> as a tree? A right-heavy binary tree of characters?
>
>
> /\
> T/\
> h/\
> a/\
> t/\
> /\
> w/\
> o/\
> u/\
> l/\
> d/\
> /\
> s/\
> u/\
> c/\
> k/\
> ./\

Let's assume the right heavy binary tree - ie a head-tail list as used commonly in Lisp or Prolog. I imagine in an RDB there would be a table with the attributes (Id,HeadChar,TailId). Each record needs a unique id (the primary key) and represents a string with the given head character and tail string.

It is easy to write all sorts of algorithms in this way. I particularly like the use of Prolog to process head-tail lists recursively. I don't know SQL very well but I imagine it would be similar although far less elegant?

Despite the logical purity there are disadvantages to be considered. Modern CPUs are quite adept at manipulating strings in the normal representation. The space and time overheads of your suggestion are significant.

Cheers,
David Received on Mon Dec 25 2006 - 02:39:35 CET

Original text of this message