Re: Enable partitionwise join for partition keys wrapped by RelabelType

From: solai v <solai(dot)cdac(at)gmail(dot)com>
To: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Cc: Jan Nidzwetzki <jan(at)planetscale(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Enable partitionwise join for partition keys wrapped by RelabelType
Date: 2026-10-30 06:46:45
Message-ID: CAF0whue__z=TxMMa6-vEeD9GZ0TcRWvHj2hUSBri1sao3SCnGg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I tested the v9 patch series for partition pruning and partition wise
optimizations involving partition keys wrapped by `RelabelType` on
PostgreSQL.
I applied all four patches in sequence and performed testing for each
of the changes.
My testing observations are as follows:
1. Partition pruning (v9-0001)
Before applying the patch, the EXPLAIN output showed an Append node
with sequential scans on both vprune_a and vprune_b, even though the
query was filtering for 'a'.
After applying the patch, the plan showed only a sequential scan on
vprune_a, excluding the unnecessary partition.
2. Partition Wise inner join (v9-0002)
I tested an inner join between two partitioned tables with varchar
partition keys wrapped in '::text'.
The execution plan showed separate Hash Join operations for the
corresponding partitions ('rel_a_1' with 'rel_b_1', and 'rel_a_2' with
'rel_b_2').
3. Partition Wise outer join (v9-0003)
I tested a 'LEFT JOIN' between the same partitioned tables. After
rebuilding and restarting the server, the execution plan showed an
'Append' node containing separate 'Hash Left Join' operations for the
corresponding partitions.
4. Full partition wise aggregation (v9-0004)

I tested 'GROUP BY' with 'COUNT(*)' on the partitioned table. The
execution plan showed separate 'HashAggregate' nodes for the
individual partitions under an 'Append ' node.
All regression tests passed.
Based on these test cases, the execution plans showed the expected
behavior for partition pruning, partition wise inner joins, outer
joins, and aggregation.

Please let me know if any additional test cases or verification would
be helpful.

Regards
solai

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-10-30 06:51:51 Re: psql: tab completion offers invalid COPY option values
Previous Message Yilin Zhang 2026-10-30 06:03:00 Re: bug: query returns different result with and without memoization.