pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pete Storer <Pete.Storer@sas.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: FW: Query execution failure
Date: Wed, 27 Sep 2023 21:00:12 -0400
Message-ID: <ZRTQHKRhSLndfB5z@momjian.us> (raw)
In-Reply-To: <Y9fjfNpP7HZh1YX9@momjian.us>
References: <BL0PR05MB66282A9070EE621D031C27C7F3CE9@BL0PR05MB6628.namprd05.prod.outlook.com>
	<BL0PR05MB66283C57D72E321591AE4EB1F3CE9@BL0PR05MB6628.namprd05.prod.outlook.com>
	<2957101.1674746628@sss.pgh.pa.us>
	<BL0PR05MB66282D22D96AB745FBBD521FF3CF9@BL0PR05MB6628.namprd05.prod.outlook.com>
	<2961799.1674749201@sss.pgh.pa.us>
	<Y9fjfNpP7HZh1YX9@momjian.us>

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  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.

Attachments:

fdw.diff (text/x-diff, 994B) download 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. <literal>output_rel</literal> is the upper relation that should receive paths representing computation of this step, and <literal>input_rel</literal> is the relation representing the input to this - step. The <literal>extra</literal> parameter provides additional details, + step. Pushdown of sorts by <literal>UPPERREL_ORDERED</literal> + should guarantee that remote sort ordering matches local ordering. + The <literal>extra</literal> parameter provides additional details, currently, it is set only for <literal>UPPERREL_PARTIAL_GROUP_AGG</literal> or <literal>UPPERREL_GROUP_AGG</literal>, in which case it points to a <literal>GroupPathExtraData</literal> structure;

view thread (18+ messages)  latest in thread

Message-ID: <ZRTQHKRhSLndfB5z@momjian.us>
Permalink:  ../ZRTQHKRhSLndfB5z@momjian.us/
Also on:    postgresql.org/message-id/ZRTQHKRhSLndfB5z@momjian.us

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, Pete.Storer@sas.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: FW: Query execution failure
  In-Reply-To: <ZRTQHKRhSLndfB5z@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox