From: | Richard Guo <guofenglinux(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Alexander Pyhalov <a(dot)pyhalov(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Inconsistency between try_mergejoin_path and create_mergejoin_plan |
Date: | 2024-06-19 13:30:39 |
Message-ID: | CAMbWs49iDxnvQkEpxJwMSK6eYRFN2YnFVwUXZ_i9aUo9P2D99w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Jun 19, 2024 at 12:49 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Richard Guo <guofenglinux(at)gmail(dot)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.
Thanks
Richard
Attachment | Content-Type | Size |
---|---|---|
v2-0001-Check-the-validity-of-commutators-for-merge-hash-clauses.patch | application/octet-stream | 8.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | jian he | 2024-06-19 13:32:57 | Re: ON ERROR in json_query and the like |
Previous Message | Ranier Vilela | 2024-06-19 13:28:37 | Re: Add pg_get_acl() function get the ACL for a database object |