Re: Number of Shared Blocks Hit - Mailing list pgsql-bugs

From Andres Freund
Subject Re: Number of Shared Blocks Hit
Date
Msg-id 20210402173509.t37bxjrnbjdsop2r@alap3.anarazel.de
Whole thread Raw
List pgsql-bugs
Hi,

On 2021-03-04 08:23:07 -0300, luis.roberto@siscobra.com.br wrote:
> While running a update, and checking EXPLAIN ANALYZE output, I found
> it strange that in the "ModifyTable" node, it shows "Shared Hit
> Blocks":351938580. If my math is correct, that amounts to more than
> 2.5TB.

Note that shared blocks hit can include repeated hits to the same
buffer. Over and over again. E.g. when you insert a new index row for
each of the rows, parts of the index will have to be traversed for each
row. Those pages will all be in the cache, hence no increased "Shared
Read Blocks", but will be counted as separate hits.

Remembering which pages we accessed previously would be quite
expensive...

Greetings,

Andres Freund



pgsql-bugs by date:

Previous
From: "Boris P. Korzun"
Date:
Subject: Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Next
From: PG Bug reporting form
Date:
Subject: BUG #16952: PG admin errors out when connecting via ssh because it can't get pg_settings