Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIBCh-000578-My for pgsql-hackers@arkaria.postgresql.org; Sun, 31 Jul 2022 15:50:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIBCf-0006wK-OK for pgsql-hackers@arkaria.postgresql.org; Sun, 31 Jul 2022 15:50:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIBCf-0006w5-F5 for pgsql-hackers@lists.postgresql.org; Sun, 31 Jul 2022 15:50:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIBCX-0001Ff-7e for pgsql-hackers@lists.postgresql.org; Sun, 31 Jul 2022 15:50:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 26VFnp231138717; Sun, 31 Jul 2022 11:49:51 -0400 From: Tom Lane To: David Rowley cc: Richard Guo , Ronan Dunklau , PostgreSQL Developers , Ranier Vilela Subject: Re: Add proper planner support for ORDER BY / DISTINCT aggregates In-reply-to: References: <4493999.1py09z8qHF@aivenronan> <3163474.aeNJFYEL58@aivenronan> Comments: In-reply-to David Rowley message dated "Fri, 29 Jul 2022 06:49:53 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1138715.1659282591.1@sss.pgh.pa.us> Date: Sun, 31 Jul 2022 11:49:51 -0400 Message-ID: <1138716.1659282591@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > I'd like to take a serious look at pushing this patch on the first few > days of August, so if anyone is following along here that might have > objections, can you do so before then? Are you going to push the other patch (adjusting select_outer_pathkeys_for_merge) first, so that we can see the residual plan changes that this patch creates? I'm not entirely comfortable with the regression test changes as posted. Likewise, it might be better to fix DEFAULT_FDW_TUPLE_COST beforehand, to detangle what the effects of that are. Also, I think it's bad style to rely on aggpresorted defaulting to false. You should explicitly initialize it anywhere that an Aggref node is constructed. It looks like there are just two places to fix (parse_expr.c and parse_func.c). Nothing else jumped out at me in a quick scan. regards, tom lane