Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: "ben(dot)play" <benjamin(dot)cohen(at)playrion(dot)com>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)
Date: 2015-06-11 12:48:07
Message-ID: CAGTBQpZoZemBRH7LRg=AnUn_RPa-QhjuoeBL9KJhNePmh6_nCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Jun 11, 2015 at 5:56 AM, ben.play <benjamin(dot)cohen(at)playrion(dot)com> wrote:
> A question : is it possible with Postgres to change the temp_tablespace only
> for a session (or page) ?
> I have a cron which takes a lot of memory. I would like to say to PostGreSql
> to use this temp_tablespace only on this command and not affect my user
> experience.

You can do it with the PGOPTIONS environment variable:

PGOPTIONS="-c temp_tablespaces=blabla" psql some_db -f some_script.sql

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Sasa Vilic 2015-06-12 00:18:29 Slow query: Postgres chooses nested loop over hash join, whery by hash join is much faster, wrong number of rows estimated
Previous Message ben.play 2015-06-11 08:56:21 Re: How to reduce writing on disk ? (90 gb on pgsql_tmp)