Re: Canonical DB

From: Dmitry A. Kazakov <>
Date: Fri, 23 Jun 2006 22:02:52 +0200
Message-ID: <1k8s5th9ekdk4$>

On Fri, 23 Jun 2006 16:48:45 +0200, mAsterdam wrote:

> Dmitry A. Kazakov wrote:

>> mAsterdam wrote:
>>>If you don't mind getting your hands dirty:
>>> mentions
>>>some Oracle specifics, in 
>>>Vadim Tropashko discusses two ways "to model a tree
>>>in the database". His new book might be on the way
>>>to the stores by now, but I did not find a reference.
>>>Joe Celko wrote 
>> Reading such things one should always ask himself: what was lost? 

> And: what was added?


>> Any tree built in any way is a tree. 
>> Once you have it, it will not fully obey RA or
>> whatever framework you used. That precisely means: an otherwise legal
>> operation applied to a tree may kill it. 

> I am not a tree-specialist.
>> It is so with all complex structures. 

> [snip integers]
> A correct model would have the constraints
> in place to preserve the invariant of the
> structure while allowing all valid modifications.

Yes. But the problem is (apart from expressing the constraints, which itself might be far from trivial: like an acyclic graph constraint etc), that you might lose the structure. To me this all is the infamous LSP problem. You have some set of things (whatever they be, relations or ellipses) with some structure (algebra), you put a constraint on the set (so you get graphs or circles), and see that some statements about the set become wrong.

My favorite examples always integers, sorry. (:-)), Put n>0 on integers and you will lose negative inverse.

The point is that it is really, really fundamental. Circles aren't ellipses though any circle is an ellipse. The structure is different. Same with trees vs. tables.

> I tried modeling the C3 MRO relationally
> but haven't found a solution (or the conviction
> that it can't be done) yet.
> and (background)
> It is a nice (and IMHO very useful) challenge.
> Any takers?

Ah, multiple dispatch, it is a hard problem. I'm unsatisfied with presently existing solutions.

BTW, it might be interesting to consider relational structures of types.

Dmitry A. Kazakov
Received on Fri Jun 23 2006 - 22:02:52 CEST

Original text of this message