Re: The horse race

From: Daniel Dittmar <daniel.dittmar_at_sap.corp>
Date: Tue, 21 Feb 2006 13:39:11 +0100
Message-ID: <dtf1lf$9hc$1_at_news.sap-ag.de>


Mark Johnson wrote:
> No that's a relation. In describing a race, the attributes might
> include, gate. The gates are ordered.
>
> But as I understand it, relations are not supposed to be sorted. So I
> wondered that if a relation includes a horse's ranking, as a 'thing'
> intrinsic, that one is trying to say that relations can be sorted?

In a database that is not set oriented, you could simply add horses to a race, the gate number would be implicit through the insertion order.

In a set oriented model, any sort order must be explicitly defined through additional attributes, in this case the gate number. The database itself does not know that this attribute has to do anything with ordering (1). To get the values in the order defined through that attribute, you have to add an ORDER BY clause, which is a feature of the cursor, not of an relation.

Daniel

(1) The optimizer of course could use an index on that attribute to retrieve the tuples in a certain order. Received on Tue Feb 21 2006 - 13:39:11 CET

Original text of this message