High temporary file usage can be a symptom of performance issues in the database. It might indicate inefficient query execution plans, inadequate memory allocation, or excessive sorting or hashing operations. By examining the temporary file usage, you can identify databases or queries that contribute to excessive disk I/O and investigate further to optimize their performance.
To monitor I/O activity and temporary file usage, execute the relevant queries to display the temporary files usage per database, impacting I/O activity.
To monitor I/O activity and temporary file usage, execute the relevant queries to display the temporary files usage per database, impacting I/O activity.
SELECT datname, temp_files AS "Temporary files", pg_size_pretty(temp_bytes) AS "Size of temporary files", stats_reset FROM pg_stat_database db ORDER BY temp_bytes DESC;