pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndQuadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Anj Adu <fotographs@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: partition pruning
Date: Mon, 08 Mar 2010 22:39:10 +0000
Message-ID: <1268087950.10620.49.camel@ebony> (raw)
In-Reply-To: <603c8f071003041440r2ec69a9dw91153f35ab2b3d53@mail.gmail.com>
References: <f2fd819a1003011129h2222281fqa67bc45e051c6dd8@mail.gmail.com>
	<603c8f071003041440r2ec69a9dw91153f35ab2b3d53@mail.gmail.com>

On Thu, 2010-03-04 at 17:40 -0500, Robert Haas wrote:
> On Mon, Mar 1, 2010 at 2:29 PM, Anj Adu <fotographs@gmail.com> wrote:
> > When I use intervals in my query e.g  col1 between current_timestamp -
> > interval '10 days' and current_timestamp...the optimizer checks ALL
> > partitions  whereas if I use   col1 between 2 hardcoded dates..only
> > the applicable partitions are scanned.
> 
> Yep.  This is one example of a more general principle:
> constant-folding happens before planning, but anything more complex
> has to wait until execution time.  So the plan can't take into account
> the value of current_timestamp in forming the plan.

It could, but it doesn't yet. Partition removal can take place in the
executor and this is currently targeted for 9.1.

-- 
 Simon Riggs           www.2ndQuadrant.com




view thread (6+ messages)  latest in thread

Message-ID: <1268087950.10620.49.camel@ebony>
Permalink:  ../1268087950.10620.49.camel@ebony/
Also on:    postgresql.org/message-id/1268087950.10620.49.camel@ebony

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: simon@2ndQuadrant.com, robertmhaas@gmail.com, fotographs@gmail.com
  Subject: Re: partition pruning
  In-Reply-To: <1268087950.10620.49.camel@ebony>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox