Re: Replace IN VALUES with ANY in WHERE clauses during optimization - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Replace IN VALUES with ANY in WHERE clauses during optimization
Date
Msg-id srnuqlttuimzmvoulhsrbgvj4vnul6b65osswvua7sfkqsvmuy@yg7apybpxp34
Whole thread Raw
In response to Re: Replace IN VALUES with ANY in WHERE clauses during optimization  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: Replace IN VALUES with ANY in WHERE clauses during optimization
Re: Replace IN VALUES with ANY in WHERE clauses during optimization
List pgsql-hackers
On 2025-04-03 18:26:48 +0300, Alexander Korotkov wrote:
> On Thu, Apr 3, 2025 at 5:18 PM Alena Rybakina <a.rybakina@postgrespro.ru> wrote:
> > Okay, I agree with you.
>
> Good.  I've reflected this limitation in comments and the commit
> message.  Also, I've adjust regression tests by removing excessive
> ones and adding more important cases.  I'm going to push this if no
> objections.

This just failed on both buildfarm and CI:

BF:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=rhinoceros&dt=2025-04-04%2013%3A52%3A13
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=iguana&dt=2025-04-04%2014%3A08%3A50
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=rhinoceros&dt=2025-04-04%2013%3A52%3A13
...


CI:

https://cirrus-ci.com/task/5466958990147584

https://api.cirrus-ci.com/v1/artifact/task/5466958990147584/testrun/build/testrun/pg_upgrade/002_pg_upgrade/log/regress_log_002_pg_upgrade

--- C:/cirrus/src/test/regress/expected/subselect.out    2025-04-04 13:20:49.429815400 +0000
+++ C:/cirrus/build/testrun/pg_upgrade/002_pg_upgrade/data/results/subselect.out    2025-04-04 13:23:33.602847700
+0000
@@ -2769,15 +2769,16 @@
 EXPLAIN (COSTS OFF)
 SELECT c.oid,c.relname FROM pg_class c JOIN pg_am a USING (oid)
 WHERE c.oid IN (VALUES (1), (2));
-                          QUERY PLAN
----------------------------------------------------------------
- Hash Join
-   Hash Cond: (a.oid = c.oid)
-   ->  Seq Scan on pg_am a
-   ->  Hash
-         ->  Index Scan using pg_class_oid_index on pg_class c
-               Index Cond: (oid = ANY ('{1,2}'::oid[]))
-(6 rows)
+                       QUERY PLAN
+---------------------------------------------------------
+ Merge Join
+   Merge Cond: (c.oid = a.oid)
+   ->  Index Scan using pg_class_oid_index on pg_class c
+         Index Cond: (oid = ANY ('{1,2}'::oid[]))
+   ->  Sort
+         Sort Key: a.oid
+         ->  Seq Scan on pg_am a
+(7 rows)

 -- Constant expressions are simplified
 EXPLAIN (COSTS OFF)


This failure was entirely predictable, as this patch has been failing on cfbot
for *months*.  Seriously. The tests passed exactly once since 2024-11-26, see:

https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F5283

Come-on.



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Draft for basic NUMA observability
Next
From: Tomas Vondra
Date:
Subject: Re: Draft for basic NUMA observability