Re: Functional dependencies and GROUP BY

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Functional dependencies and GROUP BY
Дата
Msg-id 4168.1276005935@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Functional dependencies and GROUP BY  (Greg Stark <gsstark@mit.edu>)
Ответы Re: Functional dependencies and GROUP BY  (Greg Stark <gsstark@mit.edu>)
Re: Functional dependencies and GROUP BY  (Stephen Frost <sfrost@snowman.net>)
Re: Functional dependencies and GROUP BY  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> On Tue, Jun 8, 2010 at 4:16 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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.

Well, no, any cached plan will get invalidated if the index goes away.
The big problem with this implementation is that you could create a
*rule* (eg a view) containing a query whose validity depends on the
existence of an index.  Dropping the index will not cause the rule
to be invalidated.

Perhaps the correct fix would be to mark stored query trees as having a
dependency on the index, so that dropping the index/constraint would
force a drop of the rule too.  Just pushing the check to plan time, as
I suggested yesterday, isn't a very nice fix because it would result
in the rule unexpectedly starting to fail at execution.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: [BUGS] Invalid YAML output from EXPLAIN
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Idea for getting rid of VACUUM FREEZE on cold pages