Re: pull-up subquery if JOIN-ON contains refs to upper-query - Mailing list pgsql-hackers

From Alena Rybakina
Subject Re: pull-up subquery if JOIN-ON contains refs to upper-query
Date
Msg-id 69f625e8-97ce-4554-a649-4aa6e6b9ba3d@yandex.ru
Whole thread
In response to Re: pull-up subquery if JOIN-ON contains refs to upper-query  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
Responses Re: pull-up subquery if JOIN-ON contains refs to upper-query
List pgsql-hackers
Hi! Thank you for the review!

On 28.09.2026 18:56, Ilia Evdokimov wrote:
> Hi Alena,
>
> Thanks for v8. The walker is much easier to follow now, and all of 
> Peter's points look addressed to me.
>
> I compared the results of random EXISTS/NOT EXISTS queries with and 
> without the pull-up (adding OFFSET 0 to the sub-select blocks it). The 
> queries had nested inner and outer joins in the sub-select, correlated 
> and uncorrelated quals in the ON clauses, and NULLs in the data. About 
> 13.5k queries ran, and about 1250 of them go through the new code 
> path. I found no wrong results and no assertion failures, so the 
> approach looks correct to me.
Thank you for testing! I haven't found any issues either during Smith's 
test or in a one-hour SQLancer run.
>
> My main comment is about the regression tests. A few things are 
> missing in the regression tests:
>
> 1. anti join cases
> 2. query results not only EXPLAIN output
> 3. An EXISTS sublink in the ON clause of an outer join in the parent 
> query, where the moved qual interacts with the available_rels check.
>
Agreed and added tests. Thanks!

-- 
Regards,
Alena Rybakina
Yandex


Attachment

pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: Temporary slot leak when creation fails in a subtransaction
Next
From: Rui Zhao
Date:
Subject: Re: Do we want to avoid checksumming extra files in the datadir? [was: BUG #19647]