Re: Problem with constraint exclusion on partitions

From: "Mike Pultz" <mike(at)mikepultz(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problem with constraint exclusion on partitions
Date: 2014-12-20 07:25:22
Message-ID: 167d01d01c26$1de86990$59b93cb0$@mikepultz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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:

cloud_test2=# \df+ now()

Schema | Name | Result data type | Argument data types | Type
| Security | Volatility | Owner | Language | Source code | Description

------------+------+--------------------------+---------------------+-------
-+----------+------------+-------+----------+-------------+-----------------
---------
pg_catalog | now | timestamp with time zone | | normal
| invoker | stable | pgres | internal | now | current
transaction time

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?

Mike

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G Johnston 2014-12-20 07:39:50 Re: Problem with constraint exclusion on partitions
Previous Message David G Johnston 2014-12-20 06:37:07 Re: Problem with constraint exclusion on partitions