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 1gNmna-00054Q-Es for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Nov 2018 22:41:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNmnZ-0001Sm-1z for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Nov 2018 22:41:13 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNmnY-0001Se-RQ for pgsql-hackers@lists.postgresql.org; Fri, 16 Nov 2018 22:41:12 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNmnV-0005Kp-TI for pgsql-hackers@postgresql.org; Fri, 16 Nov 2018 22:41:12 +0000 Received: by fetter.org (Postfix, from userid 1001) id 325EE40C72; Fri, 16 Nov 2018 23:41:08 +0100 (CET) Date: Fri, 16 Nov 2018 23:41:07 +0100 From: David Fetter To: Tom Lane Cc: Andreas Karlsson , Thomas Munro , Andrew Gierth , Pg Hackers Subject: Re: Early WIP/PoC for inlining CTEs Message-ID: <20181116224107.GB958@fetter.org> References: <87sh48ffhb.fsf@news-spur.riddles.org.uk> <20180725054236.GB17411@fetter.org> <87bmavfjhy.fsf@news-spur.riddles.org.uk> <20180725191447.GE17411@fetter.org> <20180727081058.GN17411@fetter.org> <8810.1542402910@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8810.1542402910@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 Fri, Nov 16, 2018 at 04:15:10PM -0500, Tom Lane wrote: > Andreas Karlsson writes: > > [ inlining-ctes-v5.patch ] > > I took a little bit of a look through this. Some thoughts: > > * I think it'd be a good idea if we made OFFSET/LIMIT in a CTE be an > alternate way of keeping it from being inlined. As the patch stands, > if that's the behavior you want, you have no way to express it in > a query that will also work in older servers. (I will manfully > resist suggesting that then we don't need the nonstandard syntax > at all ... oops, too late.) If we're on board with exposing pilot error, we could decide not to implement the nonstandard WITH syntax. One type of pilot error this would expose is a situation where: - A UDF has side effects, but is declared IMMUTABLE - A WITH clause calls it in order to get those side effects on the entire result set 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