Re: Is the plan for IN(1,2,3) always the same as for =ANY('{1,2,3}') when using PQexec with no params?

2022-11-16 Thread Tom Lane
Dmitry Koterov writes: > PG13+. Assume we have two identical queries with no arguments (as a plain > text, e.g. passed to PQexec - NOT to PQexecParams!): > - one with "a=X AND b IN(...)" > - and one with "a=X and b=ANY('{...}') > The question: is it guaranteed that the planner will always

Is the plan for IN(1,2,3) always the same as for =ANY('{1,2,3}') when using PQexec with no params?

2022-11-16 Thread Dmitry Koterov
Hi. PG13+. Assume we have two identical queries with no arguments (as a plain text, e.g. passed to PQexec - NOT to PQexecParams!): - one with "a=X AND b IN(...)" - and one with "a=X and b=ANY('{...}') The question: is it guaranteed that the planner will always choose identical plans for them