Re: Concurrency in an RDB

From: Marshall <marshall.spight_at_gmail.com>
Date: 31 Dec 2006 11:29:06 -0800
Message-ID: <1167593346.176359.35560_at_s34g2000cwa.googlegroups.com>


On Dec 24, 5:39 pm, "David" <davi..._at_iinet.net.au> wrote:
> Marshall wrote:
>
> > 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.

Whoops, you misread me. You said "hierarchical chapters of paragraphs of text" which I took to be a commendation of trees as logical representation. I countered with "a map from the natural numbers to the target set characters." Further countering the idea of trees, I said of using trees to represent paragraphs, specifically, "That would suck."

> 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?

I share your like of inductive data structures and algorithms over same. (I associate these more with SML and Haskell than Lisp or Prolog, but I suppose that's po-ta-to po-tah-to.) The relational way however would be to operate on the entire structure at once, in a set-based way.

> 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.

Here you have moved from discussing the logical model to discussing the "representation" seemingly without noticing that you have done so. The two can (and should) be as decoupled as possible. When I speak of a logical list, do I mean linked list or array list? The answer
is "neither" because I am talking about the logical list, not its implementation,
which might be a linked list, an array list, a stack of 3x5 cards, or nothing
at all.

Marshall Received on Sun Dec 31 2006 - 20:29:06 CET

Original text of this message