Re: Problem with constraint exclusion on partitions

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with constraint exclusion on partitions
Date: 2014-12-20 08:07:42
Message-ID: 1419062862060-5831553.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David G Johnston wrote
> On Saturday, December 20, 2014, Mike Pultz [via PostgreSQL] <

> ml-node+s1045698n5831551h5(at)(dot)nabble

>> wrote:
>
>> Hey David,
>>
>> > What version are you using?
>>
>> Sorry, I'm on 9.3.4.
>>
>> >Now() is a volatile function so the planner cannot omit partitions.
>> >
>> >Replace that with a constant and now it can.
>>
>> I'm not sure what you mean- now() is a stable function:
>
>
> My mistake but unless it is immutable the planner cannot evaluate it, it
> has to defer to the executor. The executor can evaluate it a single time
> for the query but it is still left with the original execution plan given
> to it by the planner.
>
>
>> it's the timestamp at the start of the transaction- so the planner should
>> have a set value for all rows.
>
>
>> Am I missing something else?
>>
>>
> Precise responsibility and timing mechanics between the planner and
> executor which I cannot give adequate exposition on off the top of my
> head...
>
> David J.

http://www.postgresql.org/docs/9.3/interactive/ddl-partitioning.html

Note the third-to-last paragraph.

David J.

--
View this message in context: http://postgresql.nabble.com/Problem-with-constraint-exclusion-on-partitions-tp5831541p5831553.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joseph Kregloh 2014-12-20 08:42:34 Re: Blocking access by remote users for a specific time period
Previous Message David G Johnston 2014-12-20 07:39:50 Re: Problem with constraint exclusion on partitions