From: Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: ERROR: left and right pathkeys do not match in mergejoin
Date: Fri, 23 Feb 2018 14:16:30 +0300
Message-ID: <a88ce274-7288-a595-386c-2be60a8b7cab@postgrespro.ru> (raw)
In-Reply-To: <754.1519343998@sss.pgh.pa.us>
References: <5dad9160-4632-0e47-e120-8e2082000c01@postgrespro.ru>
<20796.1519322593@sss.pgh.pa.us>
<886b103b-7ecf-ca2e-6159-8c355258d936@postgrespro.ru>
<754.1519343998@sss.pgh.pa.us>
Ah, I understand now. We can lie to the executor about the order,
because when we are moving based on the second outer column, we have a
stretch of equal values in the inner column, so we can consider them to
be sorted whatever way we need.
The patch applies cleanly, make check-world passes.
In create_mergejoin_plan:
* implied inner ordering is then "ORDER BY x, y, x", but the pathkey
* drops the second sort by x as redundant, and this code must cope.
-- should this read "the pathkey machinery drops"?
--
Alexander Kuzmenkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
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-hackers@postgresql.org
Cc: a.kuzmenkov@postgrespro.ru, tgl@sss.pgh.pa.us
Subject: Re: ERROR: left and right pathkeys do not match in mergejoin
In-Reply-To: <a88ce274-7288-a595-386c-2be60a8b7cab@postgrespro.ru>
* 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