From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Wells Oliver <wells.oliver@gmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: temp_buffers and work_mem and big temp tables
Date: Tue, 10 Nov 2020 14:32:17 -0500
Message-ID: <2201081.1605036737@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZHNzzCmoGS212V1Ahz8gkak_LLmDgKNVq-xnWtj55B5g@mail.gmail.com>
References: <CAOC+FBVmE5h_p6owdM4CW4Ou9U2DkuH6ypkLKM-iKP=8niMpEA@mail.gmail.com>
<CAKFQuwZHNzzCmoGS212V1Ahz8gkak_LLmDgKNVq-xnWtj55B5g@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, November 10, 2020, Wells Oliver <wells.oliver@gmail.com> wrote:
>> Hey all: I was wondering if someone might spell out which setting has more
>> impact on temporary tables being stored in memory versus disk? I have read
>> the docs but I thought I'd reach out and ask the community: I keep
>> increasing both in some scripts where Large Temp Tables are created, but
>> I'm wondering if it's more efficient just to use one or the other.
> IIUC work_mem has nothing to do with temporary tables. All tables have a
> disk component and read/writes are done via buffers.
The temp_buffers setting controls how much temporary-table data can be
kept in a session's memory. If you get to more than that, it spills out
to disk (or at least to the kernel's disk buffers).
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, wells.oliver@gmail.com
Subject: Re: temp_buffers and work_mem and big temp tables
In-Reply-To: <2201081.1605036737@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