pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedSlow Query, many tmpfiles
2+ messages / 2 participants
[nested] [flat]
* Slow Query, many tmpfiles
@ 2020-02-03 13:09 basti <mailinglist@unix-solution.de>
0 siblings, 1 reply; 2+ messages in thread
From: basti @ 2020-02-03 13:09 UTC (permalink / raw)
To: pgsql-general
Hello, some simple query are very slow since a few days, no significant
changes are done the last days. I look for disk-io, swap, looked tables,
all seems to be good.
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?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Slow Query, many tmpfiles
@ 2020-02-03 18:54 Tom Lane <tgl@sss.pgh.pa.us>
parent: basti <mailinglist@unix-solution.de>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2020-02-03 18:54 UTC (permalink / raw)
To: basti <mailinglist@unix-solution.de>; +Cc: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-02-03 18:54 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-03 13:09 Slow Query, many tmpfiles basti <mailinglist@unix-solution.de>
2020-02-03 18:54 ` Tom Lane <tgl@sss.pgh.pa.us>
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