Martin,

Testing, I see the syntax is more correctly :

select mm.uid, mm.modseq, mm.message from mailbox_messages mm where
mm.mailbox=441 and not mm.deleted and mm.uid=any(select * from 
unnest('{...}'::integer[]))

I'm trying to find if this still uses the improved query plan.

TIA

Arnt,
I see this issue has come up before in the source code - injector.cpp,
line 768.  The unnest or values variant may be a better solution than
making the huge list of parameters.  I'm trying some variations but
don't have a 500,000 message mailbox to test with (over to Martin for
that!).




On 09/05/2015 17:37, NSS Ltd wrote:
> Martin,
>
> Can you please re-run the query but instead of using VALUES(x), can you
> alter the array to have an UNNEST clause :
>
> select mm.uid, mm.modseq, mm.message from mailbox_messages mm where
> mm.mailbox=441 and not mm.deleted and mm.uid=any(unnest('{...}'))
>
> Please tell me the performance/query plan on this compared with the
> original and with your VALUES() version.
>
> Thanks
> Jim
>

Reply via email to