Re: If you were to implement the original relation algebra language...

From: Bob Badour <bbadour_at_golden.net>
Date: Thu, 20 Nov 2003 22:31:10 -0500
Message-ID: <zNednXbcWLzXGiCiRVn-uA_at_golden.net>


"Amund Trovåg"
<amundAndHereEndethMyName_at_removeINOLIKESPAMYOUSEEtexassibir.com> wrote in message news:3FBD7497.20405_at_removeINOLIKESPAMYOUSEEtexassibir.com...
>
>
> Bob Badour wrote:
> > "Amund Trovåg"
> > <amundAndHereEndethMyName_at_removeINOLIKESPAMYOUSEEtexassibir.com> wrote
in
> > message news:3FBD2223.5000107_at_removeINOLIKESPAMYOUSEEtexassibir.com...
> >
> >>Joe \"Nuke Me Xemu\" Foster wrote:
> >>
> >>>"Amund Trovåg"
> >>
> > <amundAndHereEndethMyName_at_removeINOLIKESPAMYOUSEEtexassibir.com> wrote
in
> > message
> >
> >>><news:3FBD12DB.40205_at_removeINOLIKESPAMYOUSEEtexassibir.com>...
> >>>
> >>>
> >>>
> >>>>Would precedence have a lot to say for optimization?
> >>>>
> >>>>I am currently working on doing just this, creating the grammar file
> >>>
> >>>>from BNF to JavaCC(a program that makes Java parser files for me,
based
> >>>
> >>>>on a grammar).
> >>>>
> >>>>I am not certain whether project should have precedence over the other
> >>>>operators, as this might create trouble when combined with e.g.
> >>>
> > selection.
> >
> >>>>Any thoughts, comments or tips on how the grammar should be structured
> >>>>with regard to this?
> >>>
> >
> > Have you considered properties like associativity, distributivity,
> > transitivity etc. ?
> Yes, those properties must be properly implemented, thanks for that.
>
> > In the end though, precedence is just a convention with
> > little real importance.
> Could have importance when implementing it though. Even Date says that
> project should have the higher precedence in RA in Introduction to DB,
2003.

Whether project has higher precedence in the language grammar has no relevance to whether the dbms evaluates project before join.

If addition had higher precedence than multiplication, we would just rewrite:

a*b+c = (a*b)+c

> >>>Punt and require parentheses?
> >>
> >>What does punt mean? Pardon my english here...
> >
> >
> > Please excuse Mr. Foster. He is making reference to a move in football
that
> > signifies desperation. And no, I don't mean that sissy game played in
Europe
> > where a bunch of boys in short pants and long stockings bounce balls off
> > their heads. I mean that homophobic American game where oversized
steroid
> > abusers pile on top of each other but with sufficient padding to prevent
any
> > suggestion of male-male contact.
> >
> > Then again, I seem to recall George Carlin suggested the latter game was
the
> > european game. Hmmm...
> Haha, good one!
>
> >>>It shouldn't impede optimization, and
> >>>a functional notation for those of us with "standard" keyboards will
> >>>all but demand it:
> >>>
> >>
> >
URL:http://www.cs.rochester.edu/users/faculty/nelson/courses/csc_173/relatio
> > ns/algebra.html
> >
> >>>You might be able to get away with R1 + R2 for union, R1 - R2 for
> >>>set difference, R1 * R2 for kernel panic: out of swap, etc., but you
> >>>should encourage parentheses here too, because R1 - (R1 - R2) isn't
> >>>the same as (R1 - R1) - R2.
> >>
> >>Yeah you got a point there. Association must be looked at when deciding
> >>for parentheses.
> >>I am actually going to allow the user to say "project" "union" etc,
> >>instead of using symbols...
> >
> >
> > "project and "union" are symbols.
> Yes, well, I guess you could say that. I was referring to the pi and
> sigma symbols that
> sometimes referred to in textbooks on the relational model and thought
> you would understand what I meant.

Yes, I agree: "pi" and "sigma" are also symbols. I am more likely to use them for product and sum than for project and union, though. Received on Fri Nov 21 2003 - 04:31:10 CET

Original text of this message