2 ms·
> `work_mem` is the amount of memory a connection has to, you know, do work. It's the amount of memory a connection has to do work per sorting/hashing operatio
by ianleeclark 5y ago
> `work_mem` is the amount of memory a connection has to, you know, do work.
It's the amount of memory a connection has to do work per sorting/hashing operation. https://www.postgresql.org/docs/12/runtime-config-resource.html https://www.postgresql.org/docs/12/runtime-config-resource.h...
> There's no way for example to say: I want all the connections from username "myapp" to have 10MB and those from user "reporting" to have 100MB.
Yes, you can with
`ALTER ROLE myapp SET work_mem TO '10mb';`
and
`ALTER ROLE reporting SET work_mem TO '100mb';
- jhgb 5y ago> Yes, you can with [...a helpful example...] Some days it's nice to have a lucky 10k problem (https://xkcd.com/1053 https://xkcd.com/1053) in place of a c10k problem (http://www.kegel.com/c10k.html http://www.kegel.com/c10k.html). Thanks.