Re: A problem about partitionwise join

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Jacob Champion <jchampion(at)timescale(dot)com>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, ashutosh(dot)bapat(at)enterprisedb(dot)com
Subject: Re: A problem about partitionwise join
Date: 2024-04-30 17:31:09
Message-ID: CA+TgmoZwjXu-LYV2AUb=J8G7Un+ckz9A7=Ph2pkR9WDZJW57iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 21, 2024 at 6:25 AM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> This patch was returned due to 'lack of interest'. However, upon
> verification, it appears that the reported issue still exists, and the
> proposed fix in the thread remains valid. Hence, resurrect this patch
> after rebasing it on master. I've also written a detailed commit
> message which hopefully can help people review the changes more
> effectively.

I think it's slightly questionable whether this patch is worthwhile.
The case memorialized in the regression tests, t1.a = t2.a AND t1.a =
t2.b, is a very weird thing to do. The case mentioned in the original
email, foo.k1 = bar.k1 and foo.k2 = bar.k2 and foo.k2 = 16, seems like
something that could realistically happen, especially when there are
views in use (e.g. the view joins foo and bar, and then someone
queries the view for one of the join columns). In such a case, it's
possible that foo.k2 = 16 is selective enough that we really don't
care about partition-wise join any more, but it's also possible that
it's not too selective and we do care about partition-wise join. So I
don't think that the case that the patch fixes is something that can
ever happen, but I do think it's probably fairly rare that brings any
benefit, which is why I thought that EC-based matching was an OK
approach to this problem initially. Perhaps that was the wrong idea,
though.

Does the additional logic added by this patch have a noticeable
performance cost?

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2024-04-30 17:39:04 [PATCH] json_lex_string: don't overread on bad UTF8
Previous Message Tom Lane 2024-04-30 17:29:32 Re: pg_trgm comparison bug on cross-architecture replication due to different char implementation