Does enabling pg_stat_statements reduce disk space?
pg_stat_statements shouldn't use much disk space.

It uses two files:


pg_stat_statements.stat persists pg_stat_statement's data across server restarts.

It is written upon shutdown and read on server startup. The file is deleted as soon as it has been read, so it should not be present when the server is up.
pg_stat_tmp/pgss_query_texts.stat contains the text of the queries being tracked.

This file will grow as new statements are added, but if it becomes too big, pg_stat_statements will perform a &ldquo;garbage collection&rdquo; and rewrite it.


If you suspect that there is a disk space problem with pg_stat_statements, check pg_stat_tmp/pgss_query_texts.stat. But I don't think this file can be a problem unless you set pg_stat_statements.max to an astronomically high value and run lots of different statements.