Re: Functional dependencies and GROUP BY - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Functional dependencies and GROUP BY
Date
Msg-id AANLkTikc5yLDLHHiNJx3iYEuSswRUH_9tBSyl-hfEq0U@mail.gmail.com
Whole thread Raw
In response to Re: Functional dependencies and GROUP BY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Functional dependencies and GROUP BY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Jun 8, 2010 at 4:16 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> I have developed a patch that partially implements the "functional
>> dependency" feature that allows some columns to be omitted from the
>> GROUP BY clause if it can be shown that the columns are functionally
>> dependent on the columns in the group by clause and therefore guaranteed
>> to be unique per group.
>
> The main objection to this is the same one I've had all along: it makes
> the syntactic validity of a query dependent on what indexes exist for
> the table.  At minimum, that means that enforcing the check at parse
> time is the Wrong Thing.

It also needs to ensure that the plan is invalidated if the constraint
is dropped, which I assume amounts to the same thing.




--
greg


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Idea for getting rid of VACUUM FREEZE on cold pages
Next
From: Greg Stark
Date:
Subject: Re: Parameters of GiST indexes