pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Carroll <tomfecarroll@yahoo.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Memory exhaustion due to temporary tables?
Date: Mon, 10 Dec 2018 15:45:27 -0500
Message-ID: <2584.1544474727@sss.pgh.pa.us> (raw)
In-Reply-To: <2114009259.1866365.1544469996900@mail.yahoo.com>
References: <2114009259.1866365.1544469996900.ref@mail.yahoo.com>
	<2114009259.1866365.1544469996900@mail.yahoo.com>

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




view thread (10+ messages)  latest in thread

Message-ID: <2584.1544474727@sss.pgh.pa.us>
Permalink:  ../2584.1544474727@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2584.1544474727@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tomfecarroll@yahoo.com
  Subject: Re: Memory exhaustion due to temporary tables?
  In-Reply-To: <2584.1544474727@sss.pgh.pa.us>
  References: <2114009259.1866365.1544469996900.ref@mail.yahoo.com> <2114009259.1866365.1544469996900@mail.yahoo.com> <2584.1544474727@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox