pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Lewis <mlewis@entrata.com>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: work_mem, temp_buffers, and temp_file_limit
Date: Wed, 20 Jan 2021 15:35:55 -0500
Message-ID: <785364.1611174955@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHOFxGquz=V18EtwoVfO9bBYv9VrJH8Mx0J==zom6WU=FQPAow@mail.gmail.com>
References: <CAHOFxGquz=V18EtwoVfO9bBYv9VrJH8Mx0J==zom6WU=FQPAow@mail.gmail.com>

Michael Lewis <mlewis@entrata.com> writes:
> I've read the documentation but am unclear on what memory is used when
> temp_buffers are exceeded by temp tables that are created.

The data gets flushed out to disk storage, or at least kernel disk buffers
(I don't think we'll try to fsync it).

> Does that also go towards temp_file_limit?

No, a "temp file" is distinct from a temporary relation.  Temp files
are used for anonymous transient stuff like a hash join's hash table.

> When are temp files (temp_file_limit) cleared out?

At the end of the query that used them.

			regards, tom lane





view thread (2+ messages)

Message-ID: <785364.1611174955@sss.pgh.pa.us>
Permalink:  ../785364.1611174955@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/785364.1611174955@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, mlewis@entrata.com
  Subject: Re: work_mem, temp_buffers, and temp_file_limit
  In-Reply-To: <785364.1611174955@sss.pgh.pa.us>
  References: <CAHOFxGquz=V18EtwoVfO9bBYv9VrJH8Mx0J==zom6WU=FQPAow@mail.gmail.com> <785364.1611174955@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