public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Reduce planning time for large NOT IN lists containing NULL
2+ messages / 2 participants
[nested] [flat]

* Re: Reduce planning time for large NOT IN lists containing NULL
@ 2026-02-23 17:47 Ilia Evdokimov <[email protected]>
  2026-02-23 19:44 ` Re: Reduce planning time for large NOT IN lists containing NULL Zsolt Parragi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Ilia Evdokimov @ 2026-02-23 17:47 UTC (permalink / raw)
  To: David Geier <[email protected]>; PostgreSQL Developers <[email protected]>

On 2/20/26 17:22, David Geier wrote:

> It seems like we don't have a regression test which has a NULL value in
> the NOT IN list. Maybe you can find a good place to add that one?

There are already regression tests covering NOT IN with NULL values in 
expressions.sql. Do you think we need an additional simple case, or is 
the current coverage sufficient?

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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Reduce planning time for large NOT IN lists containing NULL
  2026-02-23 17:47 Re: Reduce planning time for large NOT IN lists containing NULL Ilia Evdokimov <[email protected]>
@ 2026-02-23 19:44 ` Zsolt Parragi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Zsolt Parragi @ 2026-02-23 19:44 UTC (permalink / raw)
  To: Ilia Evdokimov <[email protected]>; +Cc: David Geier <[email protected]>; PostgreSQL Developers <[email protected]>

Hello

I think it would be a good idea to add a test, I think there's a
regression with this patch:

CREATE TABLE notin_test AS SELECT generate_series(1, 1000) AS x;
ANALYZE notin_test;

CREATE FUNCTION replace_elem(arr int[], idx int, val int)
RETURNS int[] AS $$
BEGIN
    arr[idx] := val;
    RETURN arr;
END;
$$ LANGUAGE plpgsql IMMUTABLE;

EXPLAIN SELECT * FROM notin_test WHERE x <> ALL(ARRAY[1,99,3]);
-- same array, constructed from an array with a NULL
EXPLAIN SELECT * FROM notin_test WHERE x <>
ALL(replace_elem(ARRAY[1,NULL,3], 2, 99));
DROP TABLE notin_test;
DROP FUNCTION replace_elem;

ARR_HASNULL probably should be array_contains_nulls, as ARR_HASNULL
simply checks for the existence of a NULL bitmap.






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-02-23 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-23 17:47 Re: Reduce planning time for large NOT IN lists containing NULL Ilia Evdokimov <[email protected]>
2026-02-23 19:44 ` Zsolt Parragi <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox