pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Claudio Freire <klaussfreire@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: On partitioning
Date: Fri, 12 Dec 2014 14:40:35 -0800
Message-ID: <548B6EE3.3020309@agliodbs.com> (raw)
In-Reply-To: <WM!5674e59aab89034f672b7668897d87b46824a54cca29a62ba08c1af0387796e192e949d0345717737e6887fc6cabf78c!@asav-3.01.com>
References: <20140829155607.GF7705@eldon.alvh.no-ip.org>
	<015b01d00eab$56d37700$047a6500$@lab.ntt.co.jp>
	<CA+TgmoYk9aU44Z5YRWoV2V9raj=HMbJBfORYr9GzF4vShsGvDA@mail.gmail.com>
	<002d01d01359$290cb4a0$7b261de0$@lab.ntt.co.jp>
	<CAA4eK1L53knKrrhXDTi-no53F2mF+X2a2gKXDpQ1DNi1+NMuVQ@mail.gmail.com>
	<CA+Tgmob5EvcVH73p8pCLsjkwvVe1dHEnkjk2K-fG1GJjvhcTvw@mail.gmail.com>
	<CAA4eK1LcDLmOfw3Y4L9FeAn+pMcLg6OLSTK45G9SBQUvO4tZYQ@mail.gmail.com>
	<CA+TgmoYqwOmL=ykspWmwfFivwA2T3gzyEo_94YZd3L3WpLau4g@mail.gmail.com>
	<007b01d015c6$373c21e0$a5b465a0$@lab.ntt.co.jp>
	<CA+TgmoY=aa2eGzTHn+cepnoz4Exj6bhrkNkghFxSxO84V_WroA@mail.gmail.com>
	<548B5E01.5060005@BlueT! reble.com>
	<CA+TgmobH--E+GkGHsprjN-e_4-YR4208pmE9zp90sEjBjDBDMg@mail.gmail.com>
	<CAGTBQpaqEbSO+=s1xod1G6xfawc1RRnYEL3jGp870h7APnCgGg@mail.gmail.com>
	<9766.1418422242@sss.pgh.pa.us>
	<WM!5674e59aab89034f672b7668897d87b46824a54cca29a62ba08c1af0387796e192e949d0345717737e6887fc6cabf78c!@asav-3.01.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 12/12/2014 02:10 PM, Tom Lane wrote:
> Actually, I'm not sure that's what we want.  I thought what we really
> wanted here was to postpone partition-routing decisions to runtime,
> so that the behavior would be efficient whether or not the decision
> could be predetermined at plan time.
> 
> This still leads to the same point Robert is making: the routing
> decisions have to be cheap and fast.  But it's wrong to think of it
> in terms of planner proofs.

The other reason I'd really like to have the new partitioning taken out
of the planner: expressions.

Currently, if you have partitions with constraints on, day,
"event_date", the following WHERE clause will NOT use CE and will scan
all partitions:

WHERE event_date BETWEEN ( '2014-12-11' - interval '1 month' ) and
'2014-12-11'.

This is despite the fact that the expression above gets rewritten to a
constant by the time the query is executed; by then it's too late.  To
say nothing of functions like to_timestamp(), now(), etc.

As long as partitions need to be chosen at plan time, I don't see a good
way to fix the expression problem.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (169+ messages)  latest in thread

Message-ID: <548B6EE3.3020309@agliodbs.com>
Permalink:  ../548B6EE3.3020309@agliodbs.com/
Also on:    postgresql.org/message-id/548B6EE3.3020309@agliodbs.com

 · 

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-hackers@postgresql.org
  Cc: josh@agliodbs.com, tgl@sss.pgh.pa.us, klaussfreire@gmail.com
  Subject: Re: On partitioning
  In-Reply-To: <548B6EE3.3020309@agliodbs.com>

* 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