| From: | Simon Riggs <simon(at)2ndQuadrant(dot)com> |
|---|---|
| To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
| Cc: | Anj Adu <fotographs(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: partition pruning |
| Date: | 2010-03-08 22:39:10 |
| Message-ID: | 1268087950.10620.49.camel@ebony |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
On Thu, 2010-03-04 at 17:40 -0500, Robert Haas wrote:
> On Mon, Mar 1, 2010 at 2:29 PM, Anj Adu <fotographs(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Scott Carey | 2010-03-08 23:50:24 | Re: 10K vs 15k rpm for analytics |
| Previous Message | Robert Haas | 2010-03-08 21:56:03 | Re: Estimation issue with partitioned tables |