Subject: | wish: optimize IN() to be ANY() for compatible PostgreSQL versions. |
When using "IN()" multiple times with variable lengths of the list, a
prepared statement is made for each length of the list, creating extra
overhead.
On compatible PostgreSQL versions, we can avoid this overhead by using
this, which means the same thing:
ANY (ARRAY[1,2,3,4])
The difference is that you can paramterize like this:
ANY (?)
So that you can only get one prepared statement for each length of the
IN clause.
The "wish" is that for compatible PostgreSQL versions, we will rewrite
"IN()" clauses to use "ANY".
Or perhaps alternately, we could explicity support ANY(), and handle
creating the "ARRAY[]" constructor for the users.