Re: Memory exhaustion due to temporary tables? - Mailing list pgsql-general

From Tom Lane
Subject Re: Memory exhaustion due to temporary tables?
Date
Msg-id 2584.1544474727@sss.pgh.pa.us
Whole thread Raw
In response to Memory exhaustion due to temporary tables?  (Thomas Carroll <tomfecarroll@yahoo.com>)
Responses Re: Memory exhaustion due to temporary tables?  (Thomas Carroll <tomfecarroll@yahoo.com>)
List pgsql-general
Thomas Carroll <tomfecarroll@yahoo.com> writes:
> Postgres version: 10.5.  work_mem setting: 4MB, shared_buffers setting: 800 MB, connections typically around 30-40.

I imagine you checked this already, but ... what is temp_buffers set to?
That constrains the maximum memory used for temporary-table buffers in
each process, and an unreasonable setting for it could lead to the
described behavior.

Another thing to keep in mind with long-lived "temporary" tables is
that autovacuum can't do anything with them; so it's incumbent on your
application to periodically VACUUM and/or ANALYZE them as needed.
Otherwise such tables will bloat, which could contribute to excessive
use of temporary-table buffers.

            regards, tom lane


pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Memory exhaustion due to temporary tables?
Next
From: Laurent FAILLIE
Date:
Subject: pg_dump: ERROR: array size exceeds the maximum allowed (268435455)