Обсуждение: log_temp_files confusion

Поиск
Список
Период
Сортировка

log_temp_files confusion

От
Filip Rembiałkowski
Дата:

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@la_filip LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp24899.1", size 162464
2010-01-12 13:24:49 CET 24899 filip@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@la_filip STATEMENT:  Select * From la_foo(31968)

2010-01-12 13:24:49 CET 24899 filip@la_filip LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp24899.0", size 153152
2010-01-12 13:24:49 CET 24899 filip@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@la_filip STATEMENT:  Select * From la_foo(31968)

2010-01-12 13:24:49 CET 24899 filip@la_filip LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp24899.2", size 152128
2010-01-12 13:24:49 CET 24899 filip@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@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.rembialkowski@gmail.com
http://filip.rembialkowski.net/

Re: log_temp_files confusion

От
Andrej
Дата:
2010/1/14 Filip Rembiałkowski <plk.zuber@gmail.com>:
> 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
Just a wild guess... the DOCU says it's an integer, not an INT & STRING.


Try
log_temp_files = 4194304

Re: log_temp_files confusion

От
Filip Rembiałkowski
Дата:


W dniu 13 stycznia 2010 19:52 użytkownik Andrej <andrej.groups@gmail.com> napisał:
2010/1/14 Filip Rembiałkowski <plk.zuber@gmail.com>:
> 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
Just a wild guess... the DOCU says it's an integer, not an INT & STRING.

postgresql.conf.sample has these lines:
#log_temp_files = -1            # log temporary files equal or larger
                    # than the specified size in kilobytes;
                    # -1 disables, 0 logs all temp files

I've set it in the config file to
log_temp_files = 4096

which shows as

filip@postgres=# show log_temp_files ;
 log_temp_files
----------------
 4MB
(1 row)

 

Try
log_temp_files = 4194304

I will try this, but this would mean that config system is somehow broken.




--
Filip Rembiałkowski
JID,mailto:filip.rembialkowski@gmail.com
http://filip.rembialkowski.net/