Re: Functional dependencies and GROUP BY

From: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Functional dependencies and GROUP BY
Date: 2010-06-08 14:48:44
Message-ID: 4C0E584C.60408@cs.helsinki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/8/10 5:21 PM +0300, Tom Lane wrote:
> Peter Eisentraut<peter_e(at)gmx(dot)net> writes:
>> On tis, 2010-06-08 at 09:59 +0900, Hitoshi Harada wrote:
>>> In addition, what if y is implicitly a constant? For example,
>>>
>>> SELECT x, y FROM tab2 WHERE y = a AND a = 5 GROUP BY x;
>
>> Yes, as I said, my implementation is incomplete in the sense that it
>> only recognizes some functional dependencies. To recognize the sort of
>> thing you show, you would need some kind of complex deduction or proof
>> engine, and that doesn't seem worthwhile, at least for me, at this
>> point.
>
> The question is why bother to recognize *any* cases of this form.
> I find it really semantically ugly to have the parser effectively
> doing one deduction of this form when the main engine for that type
> of deduction is elsewhere; so unless there is a really good argument
> why we have to do this case (and NOT "it was pretty easy"), I don't
> want to do it.
>
> As far as I recall, at least 99% of the user requests for this type
> of behavior, maybe 100%, would be satisfied by recognizing the
> group-by-primary-key case. So I think we should do that and be happy.

+1

Regards,
Marko Tiikkaja

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vick Khera 2010-06-08 15:08:45 Re: 3rd time is a charm.....right sibling is not next child crash.
Previous Message Tom Lane 2010-06-08 14:21:19 Re: Functional dependencies and GROUP BY