Re: Dreaming About Redesigning SQL
Date: Thu, 6 Nov 2003 09:11:36 -0500
Message-ID: <EZmdndncvY6Ayjei4p2dnA_at_golden.net>
"andrewst" <member14183_at_dbforums.com> wrote in message
news:3567017.1068124091_at_dbforums.com...
>
> Originally posted by Mike Preece
>
> > Jonathan Leffler <jleffler_at_earthlink.net> wrote in message
> > news:<Jy0qb.549$Z25.266_at_newsread4.news.pas.earthlink.net>...
>
> > > Mike Preece wrote:
>
> > > > andrewst <member14183_at_dbforums.com> wrote:
>
> > > > >First of all, as Bob pointed out yesterday, the relational
> > model does
>
> > > > >allow for relation-valued attributes, so that all the phone
> > numbers for
>
> > > > >a person could be stored within the single person record.
> > However, that
>
> > > > >would not be the "traditional" relational approach to
> > this.
>
> > > > Why not? Is there something in relational theory that says
> > that would
>
> > > > be wrong in some way?
>
> > > There are two reasons why RVA (relation-valued attributes) are
> > not
>
> > > used in the traditional approach.
>
> > > One is the horribly pragmatic point that neither SQL DBMS nor
> > any
>
> > > RDBMS (possibly excepting Alphora) actually implement support
> > for
>
> > > RVAs, so it is difficult to use in practice what only exists in
> > theory
>
> > > (that sounds familiar - c.d.p should be happy with that). The
> > main
>
> > > reason that RVAs have not been implemented is that they were
> > only
>
> > > recognized as valid in the last 10 years or so, and SQL has been
> >
>
> > > standardized rather longer than that (17 years or so).
>
> >
>
> > Why were RVAs intoduced (or accepted) into relational theory in the
>
> > firs..., I mean, 10 years ago?
I see nothing in the original papers that excludes them. Ten years ago, Date and Darwen decided to clarify a widely misunderstood issue.
> If you really want to understand this, read The Third Manifesto by C J
> Date and H Darwen. I haven't got it with me and to be honest, I can't
> remember why. I think it is more a case of accepting it as not
> subverting the relational model rather than advocating doing it.
>
>
>
> > Why haven't any of the enormous SQL-relational DBMS
> > companies
>
> > implemented support for them? I would have thought 10 years would have
>
> > been long enough and it's not as though their R&D is under-resouced
>
> > exactly.
>
> They have, kind of. But being market driven they have done it as
> part of making their DBMSs "object oriented". For example, Oracle
> lets you do this:
>
>
>
> CREATE TYPE phone_info
>
> ( phone_no VARCHAR2(20)
>
> , phone_type VARCHAR2(1)
>
> , phone_preference VARCHAR2(1)
>
> );
>
>
>
> CREATE TYPE phone_list AS TABLE OF phone_info;
>
> CREATE TABLE person
>
> ( person_id INTEGER
>
> , person_name VARCHAR2(35)
>
> , phones phone_list
>
> );
>
> INSERT INTO person VALUES
>
> ( 123
>
> , 'Andrews'
>
> , phone_list( phone_info('123-123 1234', 'H', 'E'), phone_info('123-456
> 7890', 'W', 'D') )
>
> );
>
> I may not have the syntax quite right, I never actually do this, but it
> is right in principle.
>
>
>
> > > The other reason, which might apply even if RVAs
> > were available for
>
> > > use, is that it introduces an asymmetry between the tables
>
> > Yes. That's what we've just been discussing isn't it? I thought we had
>
> > agreed that there *is* an asymmetry in the Persons:Phones relationship
>
> > - "so that all the phone numbers for a person could be stored within
>
> > the single person record".
>
> We have agreed that you may consider the relationship to be asymmetric.
> That isn't the same as saying that is HAS to be stored assymetrically.
> Your false conclusion is drawn from your erroneous belief that the
> symmetric relational version is somehow "inefficient".
Actually, it is drawn from his stupidity and his ignorance. Your feeble attempts at pedagogy are actually counterproductive.
> The fact that we
> may be less interested in the relatonship from the other end doesn't
> mean we MUST penalise that viewpoint.
Pick ignores relevant relationships. The relational model ignores nothing of relevance. Mike is incorrigibly ignorant and utterly, profoundly incapable of comprehending obvious distinctions let alone subtle distinctions. You would do everyone a favour simply by adding him to your twit-filter and by encouraging others to do the same.
> > > The traditional
>
> > > relational solution treats those queries substantially the
> > same.
>
> > Substantially? Why is that word in there?
>
> Well, obviously the 2 queries are not THE same query...
>
>
> > > Using an RVA, the code for one query is considerably different
> > from
>
> > > the other.
>
> > Interestingly enough, in Pick they would be:
>
> > List Persons Name with PhoneNumber "12345"
>
> > and
>
> > List Persons "Mike" PhoneNumber
>
> i.e. syntactically different:
>
> List <table> <attribute1> with <attribute2> <value>
>
> and
>
> List <table> <Value> <attribute2>
>
>
>
> In SQL:
>
> select person_name from person_phones where phone_number='12345';
>
> and
>
> select phone_number from person_phones where person_name=Mike';
>
> i.e. in both cases:
>
> select <attribute1> from <table> where <attribute2> = <vaue>;
>
>
> > and would run extremely efficiently regardless of whether Mike's got
> > one or a dozen phones or how many of his numbers are shared by other
> > people.
>
> So storing the data assymetrically has no impact on performance then,
> good or bad?
You are wasting your time discussing logical models with someone too stupid and too ignorant to comprehend the very practical difference between logic and physics.
> > > And one of the beauties
> > > of the relational model (which PICK might also claim - I'm not
> > sure)
> > > is that if you need to change your mind (so that RVAs are not a
> > good
> > > idea after all), then you can probably change the database too
> > without
> > > suspending the entire system.
>
> >
>
> > Well gee it sure doesn't look beautiful to me - but then I'm not
> > beholding.
>
> Are you saying that you LIKE suspending the entire system?
Actually, he is saying he prefers not to know whether the system works. It makes doing his job "easier".
> > Let's look at the evidence:
> > We agree that the person is more relevant in the persons to phones
> > relationship.
If you actually agreed to this, you are not much better than Mike.
> But we disagree over whether that is necessarily relevant to logical
> database design. We agree that it may be relevant to physical database
> design, but you don't seem to understand or accept that logical and
> physical design are different issues.
>
>
> > We agree that the relational model ignores that relevance.
If you actually agreed to this, you are no better than Mike. Pick ignores the converse relevance, but the relational model ignores nothing of relevance.
> Yes. But we see that as a good thing whereas you believe it MUST be a
> bad thing. Hmm, let's see: who is best placed to judge relational on
> that score?
I really think you should pay more heed to Date's _Principle of Incoherence_. You do nobody any good by agreeing to such ignorant, stupid nonsense.
> > Someone says we can use RVAs.
> > Someone else says they don't actually exist - and that they would
> > complicate things too much.
Mike's conundrum is caused by his stupidity and ignorance. Were he adequately educated in fundamentals, he could accurately and correctly judge for himself. As it is, he can only observe an apparent contradiction. Sadly, his stupidity will prevent him from ever getting an adequate education, but that doesn't mean every reader is so afflicted. If you are reading this and don't know what to make of it, I urge you to educate yourself on fundamentals.
> The theory exists. Most well-known SQL products do something like them,
> but probably not in a way that meets the full requirements of the theory
> (as usual!) In fact, they were adding their "OO" extensions that are
> somewhat like RVAs probably before the theory was published.
>
>
>
> > What? We're trying to get someone's phone number here guys!
> > It's simple. Pick does it simply. Someone said earlier in this thread
> > that "perfection" is important to relational database people. Is it
> > really?
No. No relational proponent thinks the relational model is perfect--only better than all the available alternatives. Only the ignorant and the stupid think the relational model has anything to do with perfection or with unattainable ideals. On the other hand, apparently, flaws are important to Pick people, because they hold onto them with desperate tenacity.
Pick does not do anything simply or well, and sometimes it cannot do simple things at all. Mike's profound ignorance and stupidity misguide him into perceiving simplicity where nothing but complexity and incapacity exist.
> If all you want is a phone number you can use a notepad. I should
> bloody hope Pick does it simply! So does relational; how could it not?
Received on Thu Nov 06 2003 - 15:11:36 CET