Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YZhbD-0002xX-Bl for pgsql-bugs@arkaria.postgresql.org; Sun, 22 Mar 2015 15:15:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YZhbC-0008Mr-RK for pgsql-bugs@arkaria.postgresql.org; Sun, 22 Mar 2015 15:15:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YZhbB-0008Mk-Tm for pgsql-bugs@postgresql.org; Sun, 22 Mar 2015 15:15:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YZhb8-0003wk-5w for pgsql-bugs@postgresql.org; Sun, 22 Mar 2015 15:15:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t2MFFQef014987; Sun, 22 Mar 2015 11:15:26 -0400 From: Tom Lane To: "David G. Johnston" cc: Paragon Corporation , "pgsql-bugs@postgresql.org" Subject: Re: BUG #12869: PostGIS 2.2 can't compile against 9.5 dev branch In-reply-to: References: <001c01d0647a$397bb260$ac731720$@pcorp.us> <14130.1427035560@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Sun, 22 Mar 2015 08:05:29 -0700" Date: Sun, 22 Mar 2015 11:15:26 -0400 Message-ID: <14986.1427037326@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org "David G. Johnston" writes: > This doesn't seem like a solution...if the flattened version of an all > constants invocation cannot be run only once where it could if it was not > flattened I would say the we've introduced a likely (and actual) > performance regression that punishes current valid and idiomatic code. I > haven't gone back and devised the entire reasoning for, and potential > benefit of, the flattening but both this and likely functions returning > composites are being negatively affected by this change. Well, it improves some queries and perhaps punishes others, but I should think the overall effect would generally be a win. Even in the case given here, it's far from clear that allowing flattening is a performance loss; the end result would have been a query containing only constants at run time, which in most scenarios would be a Good Thing. As for claiming that this is broken and should be reverted: nyet. In the first place, there is certainly no PG documentation anywhere that promises single evaluation of a function written in the manner shown here. We do, on the other hand, say that OFFSET 0 creates an optimization fence; so I see nothing wrong with my recommendation. In the second place, this was a HEAD-only change, and we certainly do not promise than the planner never changes behavior in major version updates. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs