Re: ERROR: left and right pathkeys do not match in mergejoin

From: Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR: left and right pathkeys do not match in mergejoin
Date: 2018-02-23 11:16:30
Message-ID: a88ce274-7288-a595-386c-2be60a8b7cab@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-02-23 11:34:19 Re: [HACKERS] Runtime Partition Pruning
Previous Message Thomas Munro 2018-02-23 11:04:17 Re: [HACKERS] SERIALIZABLE with parallel query