What percentage of the active, concurrent connections are doing the complex queries vs the inserts? If it's only a few (2-3) then I still think you are OK with 256MB work_mem. You could at least increase it to 128MB to see if that has any significant impact.
Regards,
Michael Vitale
Karthik Krishnakumar wrote on 3/23/2023 6:50 AM:thanks will check this.
is there some formula you are using to arrive at this number for work_mem?
we have queries that frequently have more than a dozen joins/aggregates. so have been conservative in changing work_mem...
btw, using pg version 10, (i know its old and am trying to convince folks to upgrade :)
thanks
karthik
Regards,
Michael Vitale
Michaeldba@sqlexec.com
703-600-9343