Re: Support run-time partition pruning for hash join

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support run-time partition pruning for hash join
Date: 2023-11-02 11:19:34
Message-ID: CAMbWs4_GhDa7+qRbdhLzMTXKZr2naiJc7C+tE1BcK5UVjxqncA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 29, 2023 at 6:41 PM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:

> So it seems that the new costing logic is quite crude and tends to be
> very conservative, but it can help avoid the large overhead in the worst
> cases. I think this might be a good start to push this patch forward.
>
> Any thoughts or comments?
>

I rebased this patch over the latest master. Nothing changed except
that I revised the new added test case to make it more stable.

However, the cfbot indicates that there are test cases that fail on
FreeBSD [1] (no failure on other platforms). So I set up a FreeBSD-13
locally but just cannot reproduce the failure. I must be doing
something wrong. Can anyone give me some hints or suggestions?

FYI. The failure looks like:

explain (costs off)
select p2.a, p1.c from permtest_parent p1 inner join permtest_parent p2
on p1.a = p2.a and left(p1.c, 3) ~ 'a1$';
- QUERY PLAN
-----------------------------------------------------
- Hash Join
- Hash Cond: (p2.a = p1.a)
- -> Seq Scan on permtest_grandchild p2
- -> Hash
- -> Seq Scan on permtest_grandchild p1
- Filter: ("left"(c, 3) ~ 'a1$'::text)
-(6 rows)
-
+ERROR: unrecognized node type: 1130127496

[1]
https://api.cirrus-ci.com/v1/artifact/task/5334808075698176/testrun/build/testrun/regress/regress/regression.diffs

Thanks
Richard

Attachment Content-Type Size
v3-0001-Support-run-time-partition-pruning-for-hash-join.patch application/octet-stream 59.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-11-02 11:30:55 Re: pg_upgrade and logical replication
Previous Message Shlok Kyal 2023-11-02 10:24:19 Re: [HACKERS] Allow INSTEAD OF DELETE triggers to modify the tuple for RETURNING