Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9Nrl-0006fy-1e for pgsql-committers@arkaria.postgresql.org; Wed, 23 Nov 2016 03:04:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c9Nrk-0006FE-8V for pgsql-committers@arkaria.postgresql.org; Wed, 23 Nov 2016 03:04:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c9NrX-000618-0H for pgsql-committers@postgresql.org; Wed, 23 Nov 2016 03:04:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c9NrU-0004s1-Fo for pgsql-committers@postgresql.org; Wed, 23 Nov 2016 03:04:42 +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 uAN34btS025896; Tue, 22 Nov 2016 22:04:37 -0500 From: Tom Lane To: "David G. Johnston" cc: "pgsql-committers@postgresql.org" Subject: Re: pgsql: Doc: improve documentation about composite-value usage. In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Tue, 22 Nov 2016 16:35:28 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <25894.1479870277.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 22 Nov 2016 22:04:37 -0500 Message-ID: <25895.1479870277@sss.pgh.pa.us> X-Pg-Spam-Score: -4.9 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org "David G. Johnston" writes: > ​I found it notable that you choose to introduce the OFFSET 0 hack instead > of writing a LATERAL query in the "optimization failure" example.​ > SELECT (m).* FROM (SELECT myfunc(x) AS m FROM some_table OFFSET 0) ss; > instead of​ > SELECT (m).* FROM some_table, LATERAL myfunc(some_table.x) m Meh ... I'm not really sure that the latter is any less of a hack for this purpose, or that we'd never optimize it into the unwanted form. LATERAL is a good way to fix the weird semantics of set-returning functions in the tlist, but this is not that case. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers