Re: Functions and Relations

From: NENASHI, Tegiri <tnmail42_at_gmail.com>
Date: Tue, 21 Nov 2006 15:48:11 +0100 (CET)
Message-ID: <Xns988263D1F34CCasdgba_at_194.177.96.26>


Sampo Syreeni <decoy_at_iki.fi> wrote in news:Pine.SOL.4.62.0611211345370.4310_at_kruuna.helsinki.fi:

> On 2006-11-19, NENASHI, Tegiri wrote:
>
>>> Similarly normal predicates like less-than can be represented as
>>> relations on two copies of any domain with equality. Then all you'll
>>> ever need are equijoins.
>>
>> Please explain, I do not understand. Is it not that the predicate '<'
>> is interpreted like a relation ?
>
> Yes. But the point is, the relation is of no use unless you can join
> stuff with it, and that necessarily calls for an equality predicate on
> the domain.

But one can redefine the equality predicate (=): (x,y) -> {true, false} and make it equal to (<): (x,y) -> {true, false}: both have the same form. It will retain the semantics of the natural join. In SQL, 'A join B on (A.x < B.x)'. What is the problem ?

>Once you have that, having '<' on the domain allows <-joins
> to be handled as a two-sided equijoin with the (potentially infinite)
> <-relation.

Very well. I see now. It is the matter of performance, no ? That an equijoin is faster than the other kinds of join ?

> The neat part is that sometimes you actually want the user
> to be able to implement the comparison operator, and it's even
> conceivable that someone would want to use a finite one which could be
> materialized as a bona fide relation, so the example might not be
> *totally* artificial.

It is true and I agree but what about the infinite relation that realizes '<'. How you will realize it practically ? Received on Tue Nov 21 2006 - 15:48:11 CET

Original text of this message