Re: Partitions not Working as Expected

From: Dave Johansen <davejohansen(at)gmail(dot)com>
To: bricklen <bricklen(at)gmail(dot)com>
Cc: sthomas(at)optionshouse(dot)com, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Partitions not Working as Expected
Date: 2013-06-27 17:42:13
Message-ID: CAAcYxUfCaYbpAv-sQaNGKEVK2UZA1BtL87jM8LBd81ZomaLUuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Jun 27, 2013 at 10:34 AM, bricklen <bricklen(at)gmail(dot)com> wrote:

> On Thu, Jun 27, 2013 at 10:17 AM, Shaun Thomas <sthomas(at)optionshouse(dot)com>wrote:
>
>>
>> Well yeah. That's not really the point, though. Aside from existing code,
>> hard-coding is generally frowned upon. Our devs have been using
>> CURRENT_DATE and its ilk for over six years now.
>>
>
> Would it help to put the current_date call in a wrapper function and
> coerce it as IMMUTABLE? A quick test shows that constraint exclusion seems
> to kick in, but I can't speak intelligently about whether that is wise or
> not.
>
>
Or what about something like DATE_TRUNC("DAY", now())? Or would that run
into the same optimization/planner problems as CURRENT_DATE?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Shaun Thomas 2013-06-27 18:16:00 Re: Partitions not Working as Expected
Previous Message bricklen 2013-06-27 17:34:30 Re: Partitions not Working as Expected