Re: Inconsistency between try_mergejoin_path and create_mergejoin_plan - Mailing list pgsql-hackers

From Alexander Pyhalov
Subject Re: Inconsistency between try_mergejoin_path and create_mergejoin_plan
Date
Msg-id caef79b25a49f670decdc41c3087064d@postgrespro.ru
Whole thread Raw
In response to Re: Inconsistency between try_mergejoin_path and create_mergejoin_plan  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: Inconsistency between try_mergejoin_path and create_mergejoin_plan
List pgsql-hackers
Richard Guo писал(а) 2024-06-19 16:30:
> On Wed, Jun 19, 2024 at 12:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Richard Guo <guofenglinux@gmail.com> writes:
>> > It seems to me that the new operator is somewhat artificial, since it is
>> > designed to support a mergejoin but lacks a valid commutator.  So before
>> > we proceed to discuss the fix, I'd like to know whether this is a valid
>> > issue that needs fixing.
> 
>> I do not think we should add a great deal of complexity or extra
>> planner cycles to deal with this; but if it can be fixed at low
>> cost, we should.
> 
> I think we can simply verify the validity of commutators for clauses in
> the form "inner op outer" when selecting mergejoin/hash clauses.  If a
> clause lacks a commutator, we should consider it unusable for the given
> pair of outer and inner rels.  Please see the attached patch.
> 

This seems to be working for my test cases.
-- 
Best regards,
Alexander Pyhalov,
Postgres Professional



pgsql-hackers by date:

Previous
From: Isaac Morland
Date:
Subject: Re: Add pg_get_acl() function get the ACL for a database object
Next
From: Tomas Vondra
Date:
Subject: suspicious valgrind reports about radixtree/tidstore on arm64