log_temp_files confusion

From: Filip Rembiałkowski <plk(dot)zuber(at)gmail(dot)com>
To: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: log_temp_files confusion
Date: 2010-01-13 14:51:38
Message-ID: 92869e661001130651k7bc76013y1e6f58d981ad5134@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would like to log usage of temporary files for sort/join operations, but
only when size of these files exceeds some threshold.

So I set in postgresql.conf (this is 8.4.2)
log_temp_files = 4MB

But then I got these messages in log file

2010-01-12 13:24:49 CET 24899 filip(at)la_filip LOG: temporary file: path
"base/pgsql_tmp/pgsql_tmp24899.1", size 162464
2010-01-12 13:24:49 CET 24899 filip(at)la_filip CONTEXT: SQL statement "insert
into foo ( ... ) select ...
PL/pgSQL function "la_foo" line 51 at SQL statement
2010-01-12 13:24:49 CET 24899 filip(at)la_filip STATEMENT: Select * From
la_foo(31968)

2010-01-12 13:24:49 CET 24899 filip(at)la_filip LOG: temporary file: path
"base/pgsql_tmp/pgsql_tmp24899.0", size 153152
2010-01-12 13:24:49 CET 24899 filip(at)la_filip CONTEXT: SQL statement "insert
into foo ( ... ) select ...
PL/pgSQL function "la_foo" line 51 at SQL statement
2010-01-12 13:24:49 CET 24899 filip(at)la_filip STATEMENT: Select * From
la_foo(31968)

2010-01-12 13:24:49 CET 24899 filip(at)la_filip LOG: temporary file: path
"base/pgsql_tmp/pgsql_tmp24899.2", size 152128
2010-01-12 13:24:49 CET 24899 filip(at)la_filip CONTEXT: SQL statement "insert
into foo ( ... ) select ...
PL/pgSQL function "la_foo" line 51 at SQL statement
2010-01-12 13:24:49 CET 24899 filip(at)la_filip STATEMENT: Select * From
la_foo(31968)

The combined size of temporary files named in these three warnings is far
from 4 MB.

Why is postgres logging these operations?
How is this threshold calculated at run time?

TIA

--
Filip Rembiałkowski
JID,mailto:filip(dot)rembialkowski(at)gmail(dot)com
http://filip.rembialkowski.net/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-01-13 15:00:48 Re: postgresql 8.1 windows 2008 64 bit
Previous Message Adrian Klaver 2010-01-13 14:47:29 Re: R: Re: Weird EXECUTE ... USING behaviour