Re: temp_buffers and work_mem and big temp tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: temp_buffers and work_mem and big temp tables
Date: 2020-11-10 19:32:17
Message-ID: 2201081.1605036737@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Tuesday, November 10, 2020, Wells Oliver <wells(dot)oliver(at)gmail(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Koteswara Rao Daliparthi 2020-11-11 14:02:08 PSQL CLI Drivers
Previous Message David G. Johnston 2020-11-10 19:04:36 Re: temp_buffers and work_mem and big temp tables