Re: Postgres Load Profile

From: Sam Stearns <sam(dot)stearns(at)dat(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>, Henry Ashu <henry(dot)ashu(at)dat(dot)com>
Subject: Re: Postgres Load Profile
Date: 2025-11-04 17:39:26
Message-ID: CAN6TVjkiJ2wxUfaLJKqpqb3K9E8FdUhD_DOjbQwrMkDQG_9PDw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thank you, Laurenz!

On Mon, Nov 3, 2025 at 9:25 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> On Mon, 2025-11-03 at 14: 56 -0800, Sam Stearns wrote: > Does Postgres
> have any tables you can query to find out information such as: > * Logical
> reads > * Block changes > * Physical reads > * Physical writes > * Read
> IO
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
>
> ZjQcmQRYFpfptBannerEnd
>
> On Mon, 2025-11-03 at 14:56 -0800, Sam Stearns wrote:
> > Does Postgres have any tables you can query to find out information such as:
> > * Logical reads
> > * Block changes
> > * Physical reads
> > * Physical writes
> > * Read IO requests
> > * Write IO requests
> > * Read IO (MB)
> > * Write IO (MB)
> > * User calls
> > * Parses (SQL)
> > * Hard parses (SQL)
> > * Executes (SQL)
> > * Transactions per second
>
> That smells like Oracle database.
>
> PostgreSQL does things differently, so not all of the above measures make sense.
> To make up, there are things that you should measure in a PostgreSQL database
> that don't exist in an Oracle database.
>
> PostgreSQL doesn't do direct I/O, so it has no control over which read requests
> actually cause I/O to happen and which ones can be satisfied from the kernel
> page cache.
>
> You can find statistics about read and write activity in pg_stat_database
> (per database) and pg_stat_statements (per statement). pg_stat_statements will
> also tell you how often statements were executed.
>
> In PostgreSQL, statements are always planned, unless you explicitly use a
> prepared statement or run static SQL from a function.
>
> You might want to look at pg_stat_io for overall I/O statistics per operation
> and object type.
>
> You also should look at pg_stat_all_tables for activities per table, including
> the important VACUUM-related statistics.
>
> Yours,
> Laurenz Albe
>
>

--

Samuel Stearns
Team Lead - Database
c: 971 762 6879 | o: 971 762 6879 | DAT.com

<https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Fabrice Chapuis 2025-11-05 09:19:50 Re: Startup process stuck on WAL replay
Previous Message Sam Stearns 2025-11-04 17:39:04 Re: Postgres Load Profile