Mike C <smith.not.western@gmail.com> writes:
> Ok, that makes sense. With regards to work_mem, am I right in thinking
> the child processes only allocate enough memory to meet the task at
> hand, rather than the full 16M specified in the config file?
They only allocate what's needed ... but you have to keep in mind that
work_mem is *per operation*, eg per sort or hash. A complex query could
require several such steps and thus eat several times work_mem.
regards, tom lane