public inbox for [email protected]  
help / color / mirror / Atom feed
From: Muhammad Ikram <[email protected]>
To: Loles <[email protected]>
Cc: Pgsql-admin <[email protected]>
Subject: Re: work_mem memory usage statistics
Date: Wed, 16 Oct 2024 08:37:27 +0500
Message-ID: <CAJQ7xG4BV_fbB06=OSRKFq0JaQ2GW0mK11J_yxuSSri15TzQ7Q@mail.gmail.com> (raw)
In-Reply-To: <CA+FWGK4zEPLE94c83xbTFcZVEgGma5pJ+7tnxHpk4okuQ750Jg@mail.gmail.com>
References: <CA+FWGK4zEPLE94c83xbTFcZVEgGma5pJ+7tnxHpk4okuQ750Jg@mail.gmail.com>

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 <[email protected]> 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
>


view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: work_mem memory usage statistics
  In-Reply-To: <CAJQ7xG4BV_fbB06=OSRKFq0JaQ2GW0mK11J_yxuSSri15TzQ7Q@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox