pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Daniel Westermann (DWE) <daniel.westermann@dbi-services.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Temporary tablespaces on a RAM disk
Date: Tue, 17 Mar 2020 22:05:20 +0100
Message-ID: <aacb91da412d5a0c81327e973b7a145b50947435.camel@cybertec.at> (raw)
In-Reply-To: <ZR0P278MB0028E380234DE3691D7DE7CFD2F60@ZR0P278MB0028.CHEP278.PROD.OUTLOOK.COM>
References: <ZR0P278MB0028A89FAA3E31E7F1514EF6D2F60@ZR0P278MB0028.CHEP278.PROD.OUTLOOK.COM>
	<920a66f7c939c5a59f50d62d4b3979e82c25ff21.camel@cybertec.at>
	<ZR0P278MB0028E380234DE3691D7DE7CFD2F60@ZR0P278MB0028.CHEP278.PROD.OUTLOOK.COM>

On Tue, 2020-03-17 at 19:57 +0000, Daniel Westermann (DWE) wrote:
> >> is someone using temporary tablespaces on a RAM disk ? Any experiences with that?
> >> I did some quick tests and checked the archives but could not find any
> >> information that either confirmed it is a bad idea nor the opposite.
> 
> >Taking a step back, wouldn't it be better to increase "work_mem"
> >and "temp_buffers" and set "temp_file_limit", so that temporary
> >files are avoided whenever possible and temporary tables are cached?
> 
> I don't think you can avoid that for all cases, especially when working
> with large data sets. That was one of the reasons for my initial question.

But with your proposed setup, any query that needs more temp space
than your RAM disk has will fail.  I don't think that is good for large
data sets.

Setting "work_mem" and "temp_buffers" high, you can use all the RAM
you have, and if it still is not enough, it spills to disk rather than die.

Yours,
Laurenz Albe






view thread (15+ messages)  latest in thread

Message-ID: <aacb91da412d5a0c81327e973b7a145b50947435.camel@cybertec.at>
Permalink:  ../aacb91da412d5a0c81327e973b7a145b50947435.camel@cybertec.at/
Also on:    postgresql.org/message-id/aacb91da412d5a0c81327e973b7a145b50947435.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, daniel.westermann@dbi-services.com
  Subject: Re: Temporary tablespaces on a RAM disk
  In-Reply-To: <aacb91da412d5a0c81327e973b7a145b50947435.camel@cybertec.at>
  References: <ZR0P278MB0028A89FAA3E31E7F1514EF6D2F60@ZR0P278MB0028.CHEP278.PROD.OUTLOOK.COM> <920a66f7c939c5a59f50d62d4b3979e82c25ff21.camel@cybertec.at> <ZR0P278MB0028E380234DE3691D7DE7CFD2F60@ZR0P278MB0028.CHEP278.PROD.OUTLOOK.COM> <aacb91da412d5a0c81327e973b7a145b50947435.camel@cybertec.at>

* 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