Re: Idempotence and Projection

From: <pamelafluente_at_libero.it>
Date: 20 Sep 2006 02:26:08 -0700
Message-ID: <1158744368.333186.13750_at_k70g2000cwa.googlegroups.com>


David Cressey ha scritto:

> If f(x) = SELECT * FROM x GROUP BY *
>
> then I would expect f(x) = x provided that x is a relational table. In
> other words, I expect that projecting a relation into (or it it onto?) its
> own space is an idempotent operation.
>
> However, if x contains duplicate rows,

Hi David, if you want to refer to my original problem, I must warn you you are not intending in my same sense sense.

I never talked about "duplicate rows".

The problem I am talking about is that in a chain of join you may have some values on some field replicated. This is * by the definition * of join. It's not an error.

In the relation 1-N things on side 1 gets "replicated" (say, duplicated) when you join.

This can be however a problem in a report where you have "duplication sensitive" functions, for some (often pathological) design.

In complex query done on arbitrary design you may end up with a wrong report and you may not be aware of the "errors". The join worked as intended but the result is not what was expected.

I wanted to propose a general algorithm to detect that and to create appropriate queries by appropriate splitting in subqueries.

I am talking about arbitrary design. Forget about normal forms. In my view the algorithm (systematic method) must be able to process anything. I think in terms of patterns of tables and relations (don't care about semantic or records)

If you succeed in rereading the thread, among the various "amenities", you should get what I meant. If not clear (sorry English is a foreign language to me) feel free to ask...

-P Received on Wed Sep 20 2006 - 11:26:08 CEST

Original text of this message