review:tracking temporary files in pg_stat_database - Mailing list pgsql-hackers

From Pavel Stehule
Subject review:tracking temporary files in pg_stat_database
Date
Msg-id CAFj8pRCO3FLhytV4GcQV6N1K9QokCxMYvWtHNVSykKmhxJHxAQ@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hello

This is review of Tomas' patch for counting of using temporary files:

* This patch was cleanly applied and code was compiled
* All 128 tests passed
* There are own regress tests, but usually pg_stat_* functions are not tested
* There is adequate documentation
* This patch was requested
http://archives.postgresql.org/pgsql-hackers/2011-12/msg00950.php
* Code following postgresql coding standards
* Code works


postgres=# create table xx(a int);
CREATE TABLE
postgres=# insert into xx select (random()*100000)::int from
generate_series(1,200000);
INSERT 0 200000
postgres=# \d+ xx;                         Table "public.xx"Column |  Type   | Modifiers | Storage | Stats target |
Description
--------+---------+-----------+---------+--------------+-------------a      | integer |           | plain   |
  |
 
Has OIDs: no

postgres=# \dt+ xx;                  List of relationsSchema | Name | Type  | Owner |  Size   | Description
--------+------+-------+-------+---------+-------------public | xx   | table | pavel | 7104 kB |
(1 row)

postgres=# set work_mem to '1MB';
SET
postgres=# select
pg_stat_get_db_temp_bytes(12899),pg_stat_get_db_temp_files(12899);pg_stat_get_db_temp_bytes |
pg_stat_get_db_temp_files
---------------------------+---------------------------               9889486560 |                      4103
(1 row)

postgres=# select * from xx order by 1;

postgres=# select
pg_stat_get_db_temp_bytes(12899),pg_stat_get_db_temp_files(12899);pg_stat_get_db_temp_bytes |
pg_stat_get_db_temp_files
---------------------------+---------------------------               9892288224 |                      4104
(1 row)

This patch is ready for commit

Regards

Pavel Stehule


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: WIP patch: Improve relation size functions such as pg_relation_size() to avoid producing an error when called against a no longer visible relation
Next
From: Magnus Hagander
Date:
Subject: Re: IDLE in transaction introspection