Martin Rode writes:
Arnt,
the problem with the long "ANY" clauses (2.8MB worth of Array
values), is NOT the parsing time in the Postgresql server,
whether it is the value or SQL parser.
The problem is the execution time. If we use UNNEST or the
VALUES syntax, Postgres uses something like a JOIN internally to
perform the search.
My numbers show a 200 fold better execution time with the
UNNEST approach, that should speaks for itself.
This is NOT a parsing issue, it is an execution problem. And
for that I think you can get rid of most of your magic in
WhereSet and simply use the UNNEST trick.
The version I sent you on Wednesday should generate his query:
select ... from mailbox_messages mm where mailbox=441 and not deleted;
Does it? And if it does, is that faster or slower than the version with
unnest?
Arnt