Re: Slow Query, many tmpfiles - Mailing list pgsql-general

From Tom Lane
Subject Re: Slow Query, many tmpfiles
Date
Msg-id 19422.1580756080@sss.pgh.pa.us
Whole thread Raw
In response to Slow Query, many tmpfiles  (basti <mailinglist@unix-solution.de>)
List pgsql-general
basti <mailinglist@unix-solution.de> writes:
> What I have found is this:

> postgres=# SELECT temp_files AS "Temporary files"
>      , temp_bytes AS "Size of temporary files"
> FROM   pg_stat_database db;
>  Temporary files | Size of temporary files
> -----------------+-------------------------
>                0 |                       0
>                0 |                       0
>                0 |                       0
>                0 |                       0
>            13542 |           5313912899891
> (5 rows)

> postgres@dolly:~/9.6/main/base/pgsql_tmp$ ls -la
> total 20
> drwx------ 2 postgres postgres 16384 Feb  3 02:25 .
> drwx------ 8 postgres postgres  4096 Jul 26  2017 ..

> Where does the 13542 tmp files are come from?
> How can I delete that?
> Where are they stored?

Those are temp files that have been created during queries since you last
reset the statistics counters.  By the time they're counted in this view,
they've already been deleted, so there's nothing for you to do here
maintenance-wise.  But if the numbers seem to be going up a lot over time,
that might suggest that you look for the queries causing it.

            regards, tom lane



pgsql-general by date:

Previous
From: Ravi Krishna
Date:
Subject: Re: performance of loading CSV data with COPY is 50 times faster thanPerl::DBI
Next
From: Ron
Date:
Subject: Re: performance of loading CSV data with COPY is 50 times faster thanPerl::DBI