Re: temporary file - Mailing list pgsql-admin

From Keith Fiske
Subject Re: temporary file
Date
Msg-id CAG1_KcDbtfOZEg5nAJrdWXm_UxkM6BFHQC55hbioPYMZc_ne6w@mail.gmail.com
Whole thread Raw
In response to Re: temporary file  (Albe Laurenz <laurenz.albe@wien.gv.at>)
List pgsql-admin


On Fri, Oct 9, 2015 at 8:53 AM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
Artem Tomyuk wrote:
> The questions is how to avoid creating temp files on disk?
>
> The work_mem parameter set to 1600 Megabytes, but on logs i still can see the messages like:
> LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp7905.2", size 865869824

Temporary files on disk are smaller than the memory required for the corresponding in-memory
operation, which explains why the size of the temporary file is less than 1600 MB.

You can either try to increase work_mem or change the query so that it does not perform
such large operations.

Yours,
Laurenz Albe

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Probably better off trying to optimize your query vs large work_mem values like that. 
Recommend reading over https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server to learn what work_mem actually does (and a bunch of other great tuning info). You could run yourself out of memory really fast if that's your default work_mem setting. 

--
Keith Fiske
Database Administrator
OmniTI Computer Consulting, Inc.
http://www.keithf4.com

pgsql-admin by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: temporary file
Next
From: dinesh bhandary
Date:
Subject: streaming rep setup in PCI compliance environment