pgconfigurator
pgconfigurator

log_temp_files

No restart — reload (superuser)size (kB); -1 off, 0 logs all

Logs temporary files above a size — a direct signal that work_mem is too small.

What it does

When an operation writes a temp file (a sort or hash that spilled) larger than this size, it's logged. Temp-file logging is a query-independent way to discover where work_mem is being exceeded — but at 0 (log everything) it can flood the log on a busy system.

How to tune it

pgconfigurator leaves it off (−1) by default: on a busy system logging every temp file is noisy, and pg_stat_database.temp_files / temp_bytes already track temp-file activity without the spam. If you want per-query detail during a focused tuning session, set a threshold (e.g. 10 MB) rather than 0 so only meaningful spills are logged, then turn it back off.

What the analyzer flags

  • Sort spilled to disk
  • HashAggregate touched temp files

Paste a plan into the analyzer →

Related parameters