Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlkJU-004BDT-LP for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Sep 2023 06:15:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qlkJS-009OJ0-NX for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Sep 2023 06:15:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlkJR-009OIa-Vd for pgsql-hackers@lists.postgresql.org; Thu, 28 Sep 2023 06:15:50 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qlkJO-00746t-KM for pgsql-hackers@postgresql.org; Thu, 28 Sep 2023 06:15:48 +0000 Received: from mail.postgrespro.ru (webmail.mstn.postgrespro.ru [192.168.2.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.pyhalov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id B99B1E2102D; Thu, 28 Sep 2023 09:15:43 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1695881743; bh=sURe+9K47hQDZw/Rj+qz0sggb3Zpel3Ozn71t/6nmF8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:User-Agent: Message-ID:From; b=Pi9ctqEz85YWlCLHKfVHGDa2XqC1spfV7S8tiBYKMVsB9sWD0imOe/LLbaf4NceRw qlszEZyCrfR8fH3oyHlc6hjQTdhlBbj3xkiKWrgksR/VeZemz7vE0qHy8q4Qphubd3 KSS28ocLtjNsI7YzPWuatewRwpGMIKb6Ub4trp7berjqSboYWkgxlZLKMT2qhxBWlZ N++6r45GYOBOoZKhp+1eSBLatmKO3/Cgz6KA3ipawrCn2sliSba2Uaep1xPxYKcBTE sQf+H0v0HNUWMw0L2DhOo9CWffblWaJIqQV4a2j7Rx+lKpf818oEpJRh+xj6RkbWq6 zM5p7whTmYK9Q== MIME-Version: 1.0 Date: Thu, 28 Sep 2023 09:15:43 +0300 From: Alexander Pyhalov To: "Fujii.Yuki@df.MitsubishiElectric.co.jp" Cc: PostgreSQL-development , Bruce Momjian , "Finnerty, Jim" , Andres Freund , Tom Lane , Tomas Vondra , Julien Rouhaud , Daniel Gustafsson Subject: Re: Partial aggregates pushdown In-Reply-To: References: <3c97067f40503bd8ebb3659f5daa2ff5@postgrespro.ru> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: a.pyhalov@postgrespro.ru Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Fujii.Yuki@df.MitsubishiElectric.co.jp писал 2023-09-28 07:40: >> I'm not sure that I like this mechanics of adding sort group clauses - >> it seems we do in core additional work, which is of use only for >> one extension, but at least it seems to be working. > We cannot deparse the original sort group clauses and pathtarget > when performing partial aggreggate pushdown by any FDWs. > So I think the additional sort group clauses and pathtarget are > needed by any FDWs, not only postgres_fdw. > Hi. It seems to me that *fdw postfixes don't clarify things, but just make naming more ugly. + * Adding these Vars and PlaceHolderVars to PathTarget, + * FDW cannot deparse this by the original List of SortGroupClauses. + * So, before this adding process, + * setGroupClausePartial generates another Pathtarget and another + * List of SortGroupClauses for FDW. It seems that something like: /* * Modified PathTarget cannot be used by FDW as-is to deparse this statement. * So, before modifying PathTarget, setGroupClausePartial generates * another Pathtarget and another list List of SortGroupClauses * to make deparsing possible. */ sounds better. -- Best regards, Alexander Pyhalov, Postgres Professional