Re: select statements have many shared_blks_dirtied and written

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: James Pang <jamespang886(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: select statements have many shared_blks_dirtied and written
Date: 2024-02-20 08:34:03
Message-ID: 645a24ea6ca6055a0f81ea5927ba0a08e15157c2.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tue, 2024-02-20 at 16:20 +0800, James Pang wrote:
> We have several sql "select ... from ... where  ..." ,from pg_stat_statements,
> we found the select sql has many shared_blks_dirtied, shared_blks_written.
> is it by  "hint bits" updates ?  when checkpoint just completed, we saw many
> wal_fpi , wal_bytes with this select sql too.

Yes, that are probably hint bits.

One way to avoid that is to VACUUM the table after a bulk load, that
will set hint bits.

Yours,
Laurenz Albe

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Rajesh Kumar 2024-02-21 03:37:44 Re: Wraparound
Previous Message James Pang 2024-02-20 08:20:03 select statements have many shared_blks_dirtied and written