Re: Reduce planning time for large NOT IN lists containing NULL - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: Reduce planning time for large NOT IN lists containing NULL
Date
Msg-id 83464ae9-a79a-43c8-a425-4b0773f9e759@tantorlabs.com
Whole thread Raw
In response to Re: Reduce planning time for large NOT IN lists containing NULL  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Reduce planning time for large NOT IN lists containing NULL
List pgsql-hackers

On 3/18/26 07:32, David Rowley wrote:

Thanks. I've pushed 0001.

I ended up renaming the new file to planner_est.sql as the function
handles width estimate masking too, so I thought just calling it
selectivity_est was a bit too restrictive. I went with planner_est.

+1. Thank you.

That means 0002 needed rebased. I've done that in the attached.

After the new test was committed, I realized that v8 tests relies on selectivity calculation, which are not guaranteed to remain stable over time and way vary depending on planner heuristics or platform differences. Therefore, it seems better to remove tests from v8.

Instead, we can test the invariant behavior: when NULL is present in a <> ALL clause, the selectivity is always 0.0.

The v9-patch adds three test cases: a degenerate case with only NULL, NULL combined with constants, NULL combined with both constants and non-constant expression.

Thoughts?


-- 
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Read-only connection mode for AI workflows.
Next
From: Tom Lane
Date:
Subject: Re: Serverside SNI support in libpq