Re: work_mem, temp_buffers, and temp_file_limit

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Lewis <mlewis(at)entrata(dot)com>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: work_mem, temp_buffers, and temp_file_limit
Date: 2021-01-20 20:35:55
Message-ID: 785364.1611174955@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Lewis <mlewis(at)entrata(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mohamed Wael Khobalatte 2021-01-21 00:19:16 Re: upgrade using logical replication
Previous Message Michael Lewis 2021-01-20 20:30:49 work_mem, temp_buffers, and temp_file_limit