Обсуждение: select statements have many shared_blks_dirtied and written

Поиск
Список
Период
Сортировка

select statements have many shared_blks_dirtied and written

От
James Pang
Дата:

     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.
     
  Thanks,

James 

Re: select statements have many shared_blks_dirtied and written

От
Laurenz Albe
Дата:
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