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
Re: Functional dependencies and GROUP BY Re: Functional dependencies and GROUP BY |
Список | 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 по дате отправления: