Skip to content

fix: Allow the joinscan to run for a semi/anti join, even when partitioning is not optimal.#4432

Merged
stuhood merged 1 commit into0.22.xfrom
backport-4431-to-0.22.x
Mar 20, 2026
Merged

fix: Allow the joinscan to run for a semi/anti join, even when partitioning is not optimal.#4432
stuhood merged 1 commit into0.22.xfrom
backport-4431-to-0.22.x

Conversation

@paradedb-bot
Copy link
Copy Markdown
Contributor

Description

Backport of #4431 to 0.22.x.

…ioning is not optimal. (#4431)

## What

Force the "preserved" side of a semi/anti join to be partitioned, even
if is smaller than the non-preserved side(s).

## Why

Currently, when the joinscan would not be able to use optimal
partitioning for a semi/anti join, it refuses to run, with:
> JoinScan not used: SEMI JOIN requires the left side to be the largest
source

This is reasonable, but the problem is that this is based on estimates
that change based on the data distribution and WHERE clause selectivity,
rather than based on the shape of the query itself. That means that if
you've written a query that uses `pdb.score` and tested it on a
particular set of data, it might begin failing (with an "Unsupported
query shape" error) on a different set of data.

## How

Add and use `with_forced_partitioning`.

(cherry picked from commit 0b20263)
@paradedb-bot paradedb-bot requested a review from a team as a code owner March 19, 2026 23:39
@paradedb-bot paradedb-bot added the automated-cherry-pick This PR is the result of our automated cherry-pick machinery. label Mar 19, 2026
@paradedb-bot paradedb-bot requested review from stuhood and removed request for a team March 19, 2026 23:39
@paradedb-bot paradedb-bot added the automated-cherry-pick This PR is the result of our automated cherry-pick machinery. label Mar 19, 2026
@stuhood stuhood merged commit f6862e0 into 0.22.x Mar 20, 2026
22 checks passed
@stuhood stuhood deleted the backport-4431-to-0.22.x branch March 20, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-cherry-pick This PR is the result of our automated cherry-pick machinery.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants