|
|
|
|
|
by humanfromearth
2944 days ago
|
|
Parallel scans while great for performance, I found them hard to tune considering how they work with `work_mem`, `max_connections`. The issue is that when a parallel scan starts, it's not limited to the `work_mem` which you would expect per connection. Instead, every parallel worker gets it's own `work_mem` limit. On a very busy db you can quickly end up with lots of OOM errors. What you end up doing is either disable all parallel scans or reduce `work_mem` which sometimes results in slower query performance for non-parallel queries. Suffice it to say, I wasn't smart enough to tune them and just disabled the parallel scans. Another way to do it is set a higher `work_mem` for expensive queries while having a generally low `work_mem`, but that's just hard to get right and you end up with even more bookkeeping. This behavior might have changed. If anyone knows more about this would be glad to hear what you've done. |
|