Re: IN or ANY for batch queries - Mailing list pgsql-jdbc

From Craig Ringer
Subject Re: IN or ANY for batch queries
Date
Msg-id CAMsr+YGHv96JK875v4n83rV_uPwi4J6VndfMPpjFeMJc5TKuZQ@mail.gmail.com
Whole thread Raw
In response to Re: IN or ANY for batch queries  (Charles Pritchard <chuck@jumis.com>)
List pgsql-jdbc
PostgreSQL translates IN (...) to = ANY(ARRAY[...]) internally. They're largely the same thing.

In theory for small IN lists it could specialize the query into a union with specialized plans for different values, but it doesn't do that.

Charles is right. For smaller sets use either form, whatever is convenient. For larger sets create a temp table, COPY to populate it, create indexes on it if you need to, and join on it.

pgsql-jdbc by date:

Previous
From: Charles Pritchard
Date:
Subject: Re: IN or ANY for batch queries
Next
From: Vladimir Sitnikov
Date:
Subject: Re: IN or ANY for batch queries