Re: Support run-time partition pruning for hash join

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>
Subject: Re: Support run-time partition pruning for hash join
Date: 2024-09-05 07:56:55
Message-ID: bc973ed7-b849-462c-ab44-b82da2e59873@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19/3/2024 07:12, Richard Guo wrote:
>
> On Tue, Jan 30, 2024 at 10:33 AM Richard Guo <guofenglinux(at)gmail(dot)com
> <mailto:guofenglinux(at)gmail(dot)com>> wrote:
>
> Attached is an updated patch.  Nothing else has changed.
>
>
> Here is another rebase over master so it applies again.  Nothing else
> has changed.
The patch doesn't apply to the master now.
I wonder why this work was suppressed - it looks highly profitable in
the case of foreign partitions. And the idea of cost-based enablement
makes it a must-have, I think.
I have just skimmed through the patch and have a couple of questions:
1. It makes sense to calculate the cost and remember the minimum number
of pruned partitions when the cost of HJ with probing is still
profitable. Why don't we disable this probing in runtime if we see that
the number of potentially pruning partitions is already too low?
2. Maybe I misunderstood the code, but having matched a hashed tuple
with a partition, it makes sense for further tuples to reduce the number
of probing expressions because we already know that the partition will
not be pruned.

--
regards, Andrei Lepikhov

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hunaid Sohail 2024-09-05 08:07:03 Re: [PATCH] Add roman support for to_number function
Previous Message Michael Paquier 2024-09-05 07:08:05 Re: Add callback in pgstats for backend initialization