Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdXFp-00025K-W1 for pgsql-performance@arkaria.postgresql.org; Wed, 28 Nov 2012 02:20:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TdXFo-0002oa-Vy for pgsql-performance@arkaria.postgresql.org; Wed, 28 Nov 2012 02:20:01 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdXFn-0002oU-QE for pgsql-performance@postgresql.org; Wed, 28 Nov 2012 02:19:59 +0000 Received: from moutng.kundenserver.de ([212.227.17.8]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdXFm-0001lP-07 for pgsql-performance@postgresql.org; Wed, 28 Nov 2012 02:19:59 +0000 Received: from [10.32.96.238] ([65.160.19.60]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0LyUBK-1T8CbQ1SAY-015KKa; Wed, 28 Nov 2012 03:17:44 +0100 Message-ID: <50B57440.1040802@2ndquadrant.com> Date: Tue, 27 Nov 2012 18:17:36 -0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Scott Marlowe CC: cedric@2ndquadrant.com, pgsql-performance@postgresql.org, Craig James , Kevin Grittner , Tom Lane , Claudio Freire , Merlin Moncure , David Greco Subject: Re: Hints (was Poor performance using CTE) References: <20121121134232.68590@gmx.com> <201211231105.56380.cedric@2ndquadrant.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:1geOz7u6KE+yU3B151Zpfm+Gp0E1M86Wl5EnLHboP8b Uto7CCH6UX22NQqRI3B+VHfkLNyrXviJL4gYKLFjDRFQRSa87x WfJJdXjVSzaY4F9Kv+YPTN/pRs7NHAbSOjERXsDutYS2GJ0pLz 6a/p4Usy1P2DsWAMVdR+yfcMyhVIrBuXLQ8BK4keyuUKGfHUWO sX05UCcjBuMH4JZb0m/HGIZl/2mdGFT6tBs7QGldKLf1+1thmt 6fAyOzgbKmFQccDqVfjb6CW2k1NBNZkPOxVsmriNmEiWnG5Swo DnKmtMPsI84cPPx+mknW73cFGESjI54NuSliy+Re9Of6ZIeCxg YWQX7cN4kNqr+8OLkE/A= X-Pg-Spam-Score: -1.9 (-) 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 On 27/11/2012 3:42 PM, Scott Marlowe wrote: > Here here! PostgreSQL is well known for its extensibility and this is > the perfect place for hints. I agree with the sentiment and your concerns. However, this doesn't solve the CTE problem. Some people are relying on the planner's inability to push conditions into / pull conditions out of CTEs, and otherwise re-arrange them. If support for optimising into eligible CTEs (ie CTE terms that contain only SELECT or VALUES and call no VOLATILE functions) then these applications will potentially encounter serious performance regressions. Should this feature never be added to Pg, making it different and incompatible with other DBs that implement CTE optimisation, just because some people are using it for a hacky hint like OFFSET 0? Should these applications just be broken by the update, with people told to add `OFFSET 0` or load some not-yet-existing hints module after reporting the performance issue to the list? I don't think either of those are acceptable. Sooner or later somebody's going to want to add CTE optimisation, and I don't think that "you can't" or "great, we'll do it and break everything" are acceptable responses to any proposed patch someone might come up with to add that. A GUC might be OK, as apps can always SET it before problem queries or not-yet-ported code. It'd probably reduce the rate at which people fixed their code considerably, though, going by past experience with standard_conforming_strings, etc, but it'd work. -- Craig Ringer -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance