Re: Support run-time partition pruning for hash join - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Support run-time partition pruning for hash join
Date
Msg-id CAMbWs49j+jtkDn2pZwtNFmW9Kt-PWVQJvkbLYne0e6r=_==FXA@mail.gmail.com
Whole thread Raw
In response to Re: Support run-time partition pruning for hash join  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Support run-time partition pruning for hash join
List pgsql-hackers
On Fri, Sep 6, 2024 at 9:22 AM David Rowley <dgrowleyml@gmail.com> wrote:
> Maybe instead of inventing a very pessimistic part prune Hash Join, it
> might be better to make the above work without the LATERAL + OFFSET 0
> by creating the parameterized paths Seq Scan paths. That's going to be
> an immense help when the non-partitioned relation just has a small
> number of rows, which I think your costing favoured anyway.
>
> What do you think?

This approach seems promising.  It reminds me of the discussion about
pushing join clauses into a seqscan [1].  But I think there are two
problems that we need to address to make it work.

* Currently, the costing code does not take run-time pruning into
consideration.  How should we calculate the costs of the parameterized
paths on partitioned tables?

* This approach generates additional paths at the scan level, which
may not be easily compared with regular scan paths.  As a result, we
might need to retain these paths at every level of the join tree.  I'm
afraid this could lead to a significant increase in planning time in
some cases.  We need to find a way to avoid regressions in planning
time.

[1] https://postgr.es/m/3478841.1724878067@sss.pgh.pa.us

Thanks
Richard



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN
Next
From: Tatsuo Ishii
Date:
Subject: Re: Add memory/disk usage for WindowAgg nodes in EXPLAIN