> I'd suggest to increase the value up to ~80MB, if not for the system,
> may be just for the session running this query.
> Then see if performance improved.
Don't forget you can do this for the given query without affecting the
other queries - just do something like
SET work_mem = 128M
and then run the query - it should work fine. This is great for testing
and to set environment for special users (batch processes etc.).
regards
Tomas