Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Josh Berkus wrote:
>> -- Improve performance of queries with IN() clauses containing hundreds or
>> more literal values, possibly by re-writing it as a join to a virtual
>> table.
> Hmm, wasn't there some work on this regard in 8.2?
I think it's pretty much done. Try WHERE foo IN (VALUES (1),(2),...)
if you have so many values that a non-nestloop join seems indicated.
The plain non-VALUES list form is also significantly faster than it
was, but I think it will only result in a bitmap indexscan plan type.
regards, tom lane