Re: Dreaming About Redesigning SQL - Mailing list pgsql-hackers

From Mike Mascari
Subject Re: Dreaming About Redesigning SQL
Date
Msg-id 3F7E3F49.2040709@mascari.com
Whole thread Raw
In response to Re: Dreaming About Redesigning SQL  (Christopher Browne <cbbrowne@acm.org>)
Responses Re: Dreaming About Redesigning SQL  (Hannu Krosing <hannu@tm.ee>)
List pgsql-hackers
Christopher Browne wrote:

> After takin a swig o' Arrakan spice grog, seunosewa@inaira.com (Seun Osewa) belched out...:
> 
>>This is for relational database theory experts on one hand and
>>imlementers of real-world alications on the other hand.  If there was
>>a chance to start again and design SQL afresh, for best
>>cleaness/power/performance what changes would you make?  What would
>>_your_ query language (and the underlying database concept) look
>>like?
> 
> 
> There are two notable 'projects' out there:
> 
>  1.  There's Darwen and Date's "Tutorial D" language, defined as part
>      of their "Third Manifesto" about relational databases.

I read the Third Manifesto. There are many ideas in the TTM that have
strong arguments, although I most confess I haven't read any
critiques. A few (of many) points:

1) Strict adherence to the relational model, where all of SQL's
short-comings are addressed:

A) No attribute ordering
B) No tuple ordering (sets aren't ordered)
C) No duplicate tuples (relations are sets)
D) No nulls (2VL sufficient. Missing information is meta-data)
E) No nullogical mistakes (ex: SUM of an empty relation is zero, AVG
is an error)
F) Generalized transitive closure
G) Declared attribute, relation variable, and database constraints,
including transition constraints
H) Candidate keys required (this has positive logical consequences for
the DBMS implementor)
I) Tuple and relation-valued attributes
J) No tuple-level operations

a bunch more...

2) The query language should be computationally complete. The user
should be able to author complete applications in the language, rather
than the language being a sublanguage. This reverses Codd's query
sublanguage proposed in "A Relational Model of Data for Large Shared
Data Banks"

http://www.acm.org/classics/nov95/s1p5.html

<sarcasm>
Thanks ACM for just putting part of the paper on-line, complete with
broken links and spelling errors!
</sarcasm>

3) The language (a D implementation) would ensure a separation between
the logical design of the application and the physical implementation.
The programmer should think in terms of the evaluation of relational
algebraic expressions, not manipulating physical records in disk
blocks in a file.

4) The type system should separate the actual, internal representation
from the possible representation, of which there might be many. For
example, a POINT may be internally expressed in cartesian coordinates
but may supply both polar and cartensian THE_ operators.

5) The type system should implement D & D's view of multiple
inheritance, where read-operators are inherited but write-operators
aren't. This eliminates the "Is a Circle an Ellipse?" dilemma imposed
by C++, for example. IOW, in a "D" language, a Circle is an Ellipse.

They reject Stonebreaker's ideas of OIDs and relation variable
inheritance, which of course, are in PostgreSQL.

It's a very provocative read. At a minimum, one can learn what to
avoid with SQL. The language looks neat on paper. Perhaps one day
someone will provide an open source implementation. One could envision
a "D" project along the same lines as the same sort of project that
added SQL to Postgres...

But I'd rather have PITR :-)

Mike Mascari
mascarm@mascari.com













pgsql-hackers by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Oracle/PostgreSQL incompatibilities
Next
From: Tom Lane
Date:
Subject: Re: Thoughts on maintaining 7.3