Thread: work_mem memory usage statistics

work_mem memory usage statistics

From
Loles
Date:
Hi team,

Is there any statistics table or view in the PostgreSQL catalog, extension, or similar that collects and displays work_mem memory usage statistics? It would be interesting to know the use of the work_mem by user, application and/or database.

Thanks in advance.

Loles

Re: work_mem memory usage statistics

From
Muhammad Ikram
Date:

Hi,

- No built-in routine or extension is there to show aggregation of work_mem for any query, as it is dynamically allocated.
- If work_mem requirement exceeds then it spills to disk, which can be monitored through logs. Use log_temp_files and log_statement_stats to see temp files, their size may give clues.
- pg_stat_statements and pg_stat_activity may also help in getting an idea about which queries are taking more time and their consumption of shared blocks etc.

Regards,
Ikram

On Tue, Oct 15, 2024 at 11:46 PM Loles <lolesft@gmail.com> wrote:
Hi team,

Is there any statistics table or view in the PostgreSQL catalog, extension, or similar that collects and displays work_mem memory usage statistics? It would be interesting to know the use of the work_mem by user, application and/or database.

Thanks in advance.

Loles