Replace IN VALUES with ANY in WHERE clauses during optimization

Edit
ID 5283
Title Replace IN VALUES with ANY in WHERE clauses during optimization
CI (CFBot) Summary
Stats (from CFBot) Patch version: v3, Patch count: 2, First patch: +181−60, All patches: +894−60
Topic Performance
Created 2024-10-07 19:08:07
Last modified 2025-02-06 10:09:40 (2 weeks, 1 day ago)
Latest email 2025-02-20 21:09:27 (18 hours, 36 minutes ago)
Status
2025-03: Needs review
2025-01: Moved to next CF
2024-11: Moved to next CF
Target version
Authors Andrei Lepikhov (lepikhov), Alena Rybakina (a.rybakina)
Reviewers newtglobal postgresql_contributors (newtpostgrescontributors)Become reviewer
Committer
Links
Emails
Replace IN VALUES with ANY in WHERE clauses during optimization
First at 2024-10-03 19:52:48 by Ivan Kush <ivan.kush at tantorlabs.com>
Latest at 2025-02-20 21:09:27 by Alena Rybakina <a.rybakina at postgrespro.ru>
Latest attachment (v3-0002-Add-an-implementation-of-the-x-IN-VALUES-to-x-ANY-.-.patch) at 2025-02-20 21:09:27 from Alena Rybakina <a.rybakina at postgrespro.ru>
    Attachment (v3-0002-Add-an-implementation-of-the-x-IN-VALUES-to-x-ANY-.-.patch) at 2025-02-20 21:09:27 from Alena Rybakina <a.rybakina at postgrespro.ru> (Patch: Yes)
    Attachment (v2-0001-Add-an-implementation-of-the-x-IN-VALUES-to-x-ANY.patch) at 2025-01-09 13:10:51 from Alena Rybakina <a.rybakina at postgrespro.ru> (Patch: Yes)
    Attachment (0001-Introduce-VALUES-ARRAY-transformation.patch) at 2024-10-04 09:05:01 from Andrei Lepikhov <lepihov at gmail.com> (Patch: Yes)
    Attachment (commands.sql) at 2024-10-03 19:52:48 from Ivan Kush <ivan.kush at tantorlabs.com> (Patch: No)

Annotations

When Who Mail Annotation
2024-12-11 03:49:41 newtglobal postgresql_contributors (newtpostgrescontributors) From Ivan Kush <ivan.kush@tantorlabs.com>
at 2024-10-03 19:52:48
I tested the patch with `commands.sql` and observed noticeable improvements in planning and execution time, especially with multiple tables. Even single-table queries show small time reductions (0.02–0.04 ms). The patch optimizes `IN` clauses effectively, particularly with `VALUES`. For example, `col IN (VALUES ('a'), ('b'), ('c'))` now behaves similarly to `col IN ('a', 'b', 'c')`, leading to faster execution and reduced planning overhead. Regards, Postgresql Contributors - NewtGlobal
History
When Who What
2025-02-06 10:09:40 Alexander Korotkov (smagen) Changed targetversion to None
2025-02-06 10:09:29 Alexander Korotkov (smagen) Removed smagen from committers
2025-02-06 10:09:25 Alexander Korotkov (smagen) New status: Needs review
2025-02-05 19:54:06 Alexander Korotkov (smagen) Closed in commitfest 2025-03 with status: Committed
2025-02-05 19:54:06 Alexander Korotkov (smagen) Changed committer to smagen
2025-02-04 13:45:54 Alena Rybakina (a.rybakina) Closed in commitfest 2025-01 with status: Moved to next CF
2024-12-11 03:49:41 newtglobal postgresql_contributors (newtpostgrescontributors) Added annotation "I tested the patch with `commands.sql` and observed noticeable improvements in planning and [...]" to 0184212d-1248-4f1f-a42d-f5cb1c1976d2@tantorlabs.com
2024-12-09 03:54:03 newtglobal postgresql_contributors (newtpostgrescontributors) Added newtpostgrescontributors as reviewer
2024-12-02 13:58:52 Dmitry Dolgov (erthalion) Closed in commitfest 2024-11 with status: Moved to next CF
2024-10-07 19:09:29 Alena Rybakina (alenka) Changed authors to Andrei Lepikhov (lepikhov), Alena Rybakina (a.rybakina)
2024-10-07 19:09:28 Alena Rybakina (alenka) Changed targetversion to 18
2024-10-07 19:08:07 Alena Rybakina (alenka) Attached mail thread 0184212d-1248-4f1f-a42d-f5cb1c1976d2@tantorlabs.com
2024-10-07 19:08:07 Alena Rybakina (alenka) Created patch record
Edit