Re: Dreaming About Redesigning SQL
Date: Wed, 08 Oct 2003 15:31:57 +0200
Message-ID: <3f841191.0_at_news.ruca.ua.ac.be>
Seun Osewa wrote:
> Jan Hidders <jan.hidders_at_REMOVETHIS.pandora.be> wrote in message news:<fPEgb.63802$IA4.3061832@phobos.telenet-ops.be>...
>> >>No. Procedural query language are a very big no no, because you should >>let the database choose how to optimize the queries and not let the >>users choose some optimizations on assumptions about how they think the >>data is stored.
>
> If procedural languages are so bad for database access, how come all
> the major database vendors (and now the SQL99 standard) have
> procedural extensions?
I interpreted the term "procedural query langauge" as referring to a strictly procedural query language. There is no problem with a procedural extension of a declarative language, as long as you keep the core language as declarative as possible.
> And personally I think that once you have identified the records you
> are interested in, through a 'declarative' query which can be
> optimized by the DBMS, one should be able to manipulate is with
> relative freedom from a powerful-enough procedural. GROUP BY,
> AGGREGATE FUNCTIONS, and any further processing or transformation of
> the raw data are probably not so complicated that they cannot be
> implemented as _libraries_ callable from the procedural language.
Well, they *are* that complicated. There are quite a few sophisticated query optimization tricks that databases can apply to them, and some of these depend upon the existence of certain indices and therefore knowledge of the physical layer. So those would then be lost.
- Jan Hidders
