Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: separation of church and state?

Re: separation of church and state?

From: David Cressey <cressey73_at_verizon.net>
Date: Sat, 06 Oct 2007 19:19:35 GMT
Message-ID: <bdRNi.8551$vS1.6584@trndny08>

"David Portas" <REMOVE_BEFORE_REPLYING_dportas_at_acm.org> wrote in message news:feqdnf77HdVPQJranZ2dneKdnZydnZ2d_at_giganews.com...
> "David Cressey" <cressey73_at_verizon.net> wrote in message
> news:X4PNi.3890$9r2.3214_at_trndny04...
> >
> > Oracle RDBMS, by contrast, has always forbidden ORDER BY in view
> > definitions. Other than satisfying some people's need for doctrinaire
> > purity, the RDBMS users gained nothing by this restriction.
> >
> >
>
> I disagree. Even in SQL, allowing ORDER BY in a view creates some tough
> problems.
>
> What would it actually mean for a view to be ordered? Presumably it would
> mean that at least some queries against that view should exhibit some
> pre-determined ordering. Now please define exactly which such queries
> against a view may and may not be ordered in that way (queries with joins,
> projections, aggregations, etc), including those with joins to other views
> which also have orderings of their own.
>

Rather than try to answer your question in detail, I'm simply going to point you to Oracle/Rdb.
It solved all the tough problems you have raised. It worked just fine in practice. If the user of a view specifies an order, it overrides the order built in to the view definition. If the view is used in a context that requires an unordered table, then it uses an unordered table.

I do not know whether or not the Rdb optimizer was smart enough to omit a superfluous order by step. I don't care, either.

And, if the view was used in the context of a report writer that only understood sequential data sources, the facility of providing an ORDER BY clause in the view definition was a godsend.

> Assuming you can define such a set of rules, how is the product supposed
to
> behave when the user breaks the rules by issuing a query that cannot
> properly be ordered according to the view definition?

> Do we disallow such
> queries and raise an error or do we silently return a result set that
isn't
> sorted? In the latter case, the user must be expected to understand when
the
> rules are being broken and presumably must also know in advance what the
> ordering is supposed be. What benefit can the user possibly gain from this
> added complexity?
>

I refer you again to Oracle/Rdb and to its user community. You may think it's a problem, but it isn't.

> --
> David Portas
>
>
>
Received on Sat Oct 06 2007 - 14:19:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US