Re: Constraint exclusion for timestamp expression

From: Victor Yegorov <vyegorov(at)gmail(dot)com>
To:
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Constraint exclusion for timestamp expression
Date: 2014-05-20 12:38:29
Message-ID: CAGnEboj-Ln0SJXrpMMp-8vyzQDGHuw0rEsgdqM-U3rzLU_zfLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2014-05-20 14:26 GMT+03:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> Victor Yegorov <vyegorov(at)gmail(dot)com> writes:
> > How can I enforce pruning to kick in for the initial expressions?
>
> You already found out: use constants. The planner can't remove
> partitions on the basis of clauses involving volatile, or even
> stable, functions, because their results might be different at
> runtime.
>

Do you mean constants are the only way here?
I.e. there is absolutely no way to use any of the "current date /
timestamp" functions available?

I've been trying to wrap current expressions into immutable functions, like
`date_trunc`, without any luck.

--
Victor Y. Yegorov

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ondrej Chaloupka 2014-05-20 13:55:10 Revoking permission on view pg_prepared_xacts
Previous Message Tom Lane 2014-05-20 11:26:55 Re: Constraint exclusion for timestamp expression