Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UsJZr-0007JV-Si for pgsql-performance@arkaria.postgresql.org; Thu, 27 Jun 2013 21:18:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UsJZr-0000ah-5W for pgsql-performance@arkaria.postgresql.org; Thu, 27 Jun 2013 21:18:03 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UsJZq-0000ab-Bb for pgsql-performance@postgresql.org; Thu, 27 Jun 2013 21:18:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UsJZo-0008KN-Dd for pgsql-performance@postgresql.org; Thu, 27 Jun 2013 21:18:01 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r5RLHud3000655; Thu, 27 Jun 2013 17:17:56 -0400 (EDT) From: Tom Lane To: Andres Freund cc: sthomas@optionshouse.com, Dave Johansen , bricklen , "pgsql-performance@postgresql.org" Subject: Re: Partitions not Working as Expected In-reply-to: <20130627204317.GP1254@alap2.anarazel.de> References: <51CC652F.3010304@optionshouse.com> <51CC73B6.2050406@optionshouse.com> <51CC8160.2080905@optionshouse.com> <27533.1372358546@sss.pgh.pa.us> <20130627204317.GP1254@alap2.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 27 Jun 2013 22:43:17 +0200" Date: Thu, 27 Jun 2013 17:17:55 -0400 Message-ID: <654.1372367875@sss.pgh.pa.us> X-Pg-Spam-Score: -0.5 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Andres Freund writes: > Couldn't we at least significantly improve on the status quo by > detecting we're currently planning a query that's only going to be > executed once (because it's directly executed or because were planning a > onetime plan for specific parameters) and inline stable functions before > doing the theorem proving? I think Haas went down that rabbit hole before you. The current definition of stable functions is not strong enough to guarantee that a plan-time evaluation would give the same result as a run-time evaluation, not even in one-shot-plan cases. The obvious reason why not is that the planner isn't using the same snapshot that the executor will use (which is not that easy to change, see his failed patch from a year or so back). But even if we rejiggered things enough so the query did use the same snapshot that'd been used for planning, I'm not very convinced that such an assumption would be valid. The assumptions for stable functions are pretty weak really. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance