Re: Is this possible w/o a stored procedure?

From: Harry Chomsky <harryc_at_chomsky.net>
Date: 2000/06/20
Message-ID: <KZM35.20067$FC6.447550_at_newsread1.prod.itd.earthlink.net>#1/1


"Joe Celko" <71062.1056_at_compuserve.com> wrote in message news:8imms8$fu7$1_at_nnrp1.deja.com...
>
> >> Every time you add, delete or move an item, you have to navigate
> through the tree structure and update all the affected lft and rgt
> values. There's no way to do this using standard database operations.
> <<
>
> No, if you change the *structure* of the tree, then you have to update
> the lft and rgt values. Changes to the *elements* are done in a
> separate table.

Yes -- just as I said: every time you *add*, *delete* or *move* an item, you have to update all the lft and rgt values. You may think you are contradicting me here, but if you actually look at what I said, you will see that you are not.

> The basic characteristic of a normalized table is that it is free from
> anomalies. One fact, one place, one time. A table is a set; a set is
> a collection made up of one kind of thing. The adjacency list model
> holds both structure and elements, which are different kinds of things,
> namely a relationship and entities.
>
> When you update the adjacency list model, you have to repeat updates
> for the same entity as both a subordinate and superior. When you
> delete a node from the adjacency list model, you destroy subordination
> (i.e. daggling trees), while nested set preserve subordination, which
> is shown by containment.

Please let's not get into this discussion again. Anybody who's curious may look in Deja News to see how it played out last time. Although Mr. Celko is apparently viewed as an "expert", I was ultimately forced to conclude that he has no real understanding of the mathematics of normalization. His arguments do sound fairly convincing when they're presented in vague, hand-waving terms such as the above. But when I tried to pin him down, he began contradicting himself right and left. (or is that rgt and lft?) Received on Tue Jun 20 2000 - 00:00:00 CEST

Original text of this message