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 1qlfOF-003pxZ-NN for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Sep 2023 01:00:27 +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 1qlfOD-0072X7-UT for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Sep 2023 01:00:26 +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 1qlfOD-0072WN-KJ for pgsql-bugs@lists.postgresql.org; Thu, 28 Sep 2023 01:00:26 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlfO2-0071Zm-I9 for pgsql-bugs@lists.postgresql.org; Thu, 28 Sep 2023 01:00:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=EYmv6BIcGDA36pjc4zhYNr5snZdxBA1/dqyJHPZP1z0=; b=mGZh/ Zyn4HrILyrZWVIm3GgeruQq+OUGikWyfqAZFhImqa6pSUMB/pGlxn7iKyrSdbUlGhwI7X6rnmnvnC b3ufQwIHk2wvlPTzE4347vPwnZeqV1CJj5PuXkU7yutH1SaN+7nHLdFDQd9CMh7kTPw72RXVIWnPw s1GyOUUUqAvf8RD4Eqm0Tz175nC2mFiIXoQqyGOzpygxBrldrNKVOW3i9ua52ekDPkDJKKx274xhu /OW0rMPiuFKNvZEmexs3wkZsJEPLR3jZguS6xvZV0dJ4qgAy779/aQQmu00gUBUIEejMyGazijeXS ZCYs0OF+J1jpEAgjbfjN1cgLOZKFw==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qlfO0-007Ke5-1x; Wed, 27 Sep 2023 21:00:12 -0400 Date: Wed, 27 Sep 2023 21:00:12 -0400 From: Bruce Momjian To: Tom Lane Cc: Pete Storer , "pgsql-bugs@lists.postgresql.org" Subject: Re: FW: Query execution failure Message-ID: References: <2957101.1674746628@sss.pgh.pa.us> <2961799.1674749201@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="zluAMOI1cSF9fq4/" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --zluAMOI1cSF9fq4/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 30, 2023 at 10:34:20AM -0500, Bruce Momjian wrote: > On Thu, Jan 26, 2023 at 11:06:41AM -0500, Tom Lane wrote: > > I don't know anything about the mysql FDW, but another possible route > > to fixing things is to get it to not believe that the remote's sort > > ordering matches the local one. If the plan were relying on a local > > sort instead of a remote sort then everything would be fine. > > When we implemented sort pushdown to FDWs I had not considered how hard > it might be to match sort ordering, especially considering the problem > we have in matching orderings from different operating system versions. > > Is this documented somewhere? The attached patch documents this remote sort order requirement. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you. --zluAMOI1cSF9fq4/ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="fdw.diff" diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml index 25832d227f..17e17233fe 100644 --- a/doc/src/sgml/fdwhandler.sgml +++ b/doc/src/sgml/fdwhandler.sgml @@ -415,7 +415,9 @@ GetForeignUpperPaths(PlannerInfo *root, currently being considered. output_rel is the upper relation that should receive paths representing computation of this step, and input_rel is the relation representing the input to this - step. The extra parameter provides additional details, + step. Pushdown of sorts by UPPERREL_ORDERED + should guarantee that remote sort ordering matches local ordering. + The extra parameter provides additional details, currently, it is set only for UPPERREL_PARTIAL_GROUP_AGG or UPPERREL_GROUP_AGG, in which case it points to a GroupPathExtraData structure; --zluAMOI1cSF9fq4/--