Re: [PATCH] pg_stat_toast

From: Andres Freund <andres(at)anarazel(dot)de>
To: "Gunnar \"Nick\" Bluth" <gunnar(dot)bluth(at)pro-open(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, gkokolatos(at)protonmail(dot)com
Subject: Re: [PATCH] pg_stat_toast
Date: 2021-12-12 23:41:13
Message-ID: 20211212234113.6rhmqxi5uzgipwx2@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-12-13 00:00:23 +0100, Gunnar "Nick" Bluth wrote:
> Regarding stats size; it adds one PgStat_BackendToastEntry
> (PgStat_BackendAttrIdentifier + PgStat_ToastCounts, should be 56-64 bytes or
> something in that ballpark) per TOASTable attribute, I can't see that make
> any system break sweat ;-)

That's actually a lot. The problem is that all the stats data for a database
is loaded into private memory for each connection to that database, and that
the stats collector regularly writes out all the stats data for a database.

> A quick run comparing 1.000.000 INSERTs (2 TOASTable columns each) with and
> without "pgstat_track_toast" resulted in 12792.882 ms vs. 12810.557 ms. So
> at least the call overhead seems to be neglectible.

Yea, you'd probably need a few more tables and a few more connections for it
to have a chance of mattering meaningfully.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-12-12 23:57:00 Re: Logical replication error "no record found" /* shouldn't happen */
Previous Message Juan José Santamaría Flecha 2021-12-12 23:38:53 Re: can we add subscription TAP test option "vcregress subscriptioncheck" for MSVC builds?