Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gofij-0006Xs-EN for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Jan 2019 02:35:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gofih-00065o-F4 for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Jan 2019 02:35:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gofih-00061W-2h for pgsql-hackers@lists.postgresql.org; Wed, 30 Jan 2019 02:35:19 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gofie-0004PJ-Cf for pgsql-hackers@postgresql.org; Wed, 30 Jan 2019 02:35:17 +0000 Received: by fetter.org (Postfix, from userid 1001) id 172E44023C; Wed, 30 Jan 2019 03:35:14 +0100 (CET) Date: Wed, 30 Jan 2019 03:35:13 +0100 From: David Fetter To: Tom Lane Cc: Michael Paquier , Peter Eisentraut , Robert Haas , Andreas Karlsson , Andres Freund , Thomas Munro , Andrew Gierth , Pg Hackers Subject: Re: Early WIP/PoC for inlining CTEs Message-ID: <20190130023512.GX12076@fetter.org> References: <00818be9-2f63-f584-efcd-d97ee0662905@proxel.se> <5715d93e-6ebc-be17-c2c3-56a873100a38@proxel.se> <29576.1548084476@sss.pgh.pa.us> <12408.1548707732@sss.pgh.pa.us> <32184.1548713132@sss.pgh.pa.us> <20190129045158.GD3121@paquier.xyz> <17787.1548791564@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17787.1548791564@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Jan 29, 2019 at 02:52:44PM -0500, Tom Lane wrote: > Michael Paquier writes: > > On Mon, Jan 28, 2019 at 05:05:32PM -0500, Tom Lane wrote: > >> Yeah, I thought about that too, but it doesn't seem like an improvement. > >> If the query is very long (which isn't unlikely) I think people would > >> prefer to see the option(s) up front. > > > Having these options at the front of the WITH clause looks more > > natural to me. > > Well, we've managed to get agreement on the semantics of this thing, > let's not get hung up on the syntax details. > > I propose that we implement and document this as > > WITH ctename AS [ MATERIALIZE { ON | OFF } ] ( query ) I think this would be better with parentheses like this: WITH ctename [ ( MATERIALIZE { ON | OFF } ) ] AS ( query ) [, ... ] and it's a lot easier to add more query hints later. Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate