Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e473x-0004ya-HZ for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Oct 2017 15:12:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e473x-0000fc-0z for pgsql-bugs@arkaria.postgresql.org; Mon, 16 Oct 2017 15:12:17 +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 1e473F-0007qH-08 for pgsql-bugs@postgresql.org; Mon, 16 Oct 2017 15:11:33 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e473B-0001R0-Q5 for pgsql-bugs@postgresql.org; Mon, 16 Oct 2017 15:11:32 +0000 Received: from [192.168.127.1] (port=13888 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1e4738-000HIz-Cl; Mon, 16 Oct 2017 15:11:26 +0000 Received: from [127.0.0.1] (port=44938 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1e4737-000Jrf-Il; Mon, 16 Oct 2017 15:11:25 +0000 From: Andrew Gierth To: Tom Lane Cc: Heikki Linnakangas , Pg Bugs Subject: Re: Improper const-evaluation of HAVING with grouping sets and subquery pullup In-Reply-To: <32319.1508163874@sss.pgh.pa.us> (Tom Lane's message of "Mon, 16 Oct 2017 10:24:34 -0400") Message-ID: <8760bfku2u.fsf@news-spur.riddles.org.uk> References: <7dbdcf5c-b5a6-ef89-4958-da212fe10176@iki.fi> <1197.1507820787@sss.pgh.pa.us> <87efq3lq93.fsf@news-spur.riddles.org.uk> <87a80rli2w.fsf@news-spur.riddles.org.uk> <32319.1508163874@sss.pgh.pa.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Mon, 16 Oct 2017 16:11:24 +0100 MIME-Version: 1.0 Content-Type: text/plain 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 >>>>> "Tom" == Tom Lane writes: >> Further experimentation reveals that this change has the effect of >> blocking constant-folding in aggregate input expressions that refer >> to constant outputs of the subquery. Is it worth doing anything >> about that? Tom> Uh ... but I thought the point here is that the outputs aren't Tom> really constant in the presence of grouping sets. select x, y, sum(z) from (select 1 as x, 2 as y, 3 as z) s group by grouping sets (x,y); x and y aren't constants, but z is. -- Andrew (irc:RhodiumToad) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs