pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: basti <mailinglist@unix-solution.de>
Cc: pgsql-general@postgresql.org
Subject: Re: Slow Query, many tmpfiles
Date: Mon, 03 Feb 2020 13:54:40 -0500
Message-ID: <19422.1580756080@sss.pgh.pa.us> (raw)
In-Reply-To: <f5317b9b-8421-7c39-8a3e-d9371a05f326@unix-solution.de>
References: <f5317b9b-8421-7c39-8a3e-d9371a05f326@unix-solution.de>

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





view thread (2+ messages)

Message-ID: <19422.1580756080@sss.pgh.pa.us>
Permalink:  ../19422.1580756080@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19422.1580756080@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mailinglist@unix-solution.de
  Subject: Re: Slow Query, many tmpfiles
  In-Reply-To: <19422.1580756080@sss.pgh.pa.us>
  References: <f5317b9b-8421-7c39-8a3e-d9371a05f326@unix-solution.de> <19422.1580756080@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox