Re: partitionning - Mailing list pgsql-general

From Tom Lane
Subject Re: partitionning
Date
Msg-id 13974.1110688551@sss.pgh.pa.us
Whole thread Raw
In response to Re: partitionning  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: partitionning  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> Note, the planner does have most of the intelligence needed to
> determine when it can skip a partition.

The issue isn't really whether the planner *could* use a constraint
to decide that a table need not be scanned at all.  As you say, we
have practically all the infrastructure needed for such inferences.
To me the real reason why we don't do that is the lack of a mechanism
to force the plan to be reconsidered if the constraint is dropped.
Without the constraint, the plan will still run, but it may deliver
wrong answers.  (The closest current equivalent is the possibility of
dropping an index that a plan depends on --- but at least we will fail
outright if the index isn't there anymore.)

In short, I won't accept any such patch until after we build a mechanism
for invalidating cached plans.  Which we need anyway for other reasons.
So the path ahead is clear, in my mind anyway ... but this is not the
next step to take.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Using sequence name depending on other column
Next
From: Ron Mayer
Date:
Subject: Re: [PATCHES] A way to let Vacuum warn if FSM settings are low. [final?]