Re: [PATCH] pg_stat_toast

From: "Gunnar \"Nick\" Bluth" <gunnar(dot)bluth(at)pro-open(dot)de>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>
Subject: Re: [PATCH] pg_stat_toast
Date: 2022-04-06 16:01:26
Message-ID: cc361462-c44b-2a3d-e48b-19744b4c4a1c@pro-open.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Am 06.04.22 um 17:22 schrieb Robert Haas:
> On Tue, Apr 5, 2022 at 10:34 PM Andres Freund <andres(at)anarazel(dot)de> wrote:
>>> Anyway, my (undisputed up to now!) understanding still is that only
>>> backends _looking_ at these stats (so, e.g., accessing the pg_stat_toast
>>> view) actually read the data. So, the 10-15% more space used for pg_stat
>>> only affect the stats collector and _some few_ backends.
>>
>> It's not so simple. That stats collector constantly writes these stats out to
>> disk. And disk bandwidth / space is of course a shared resource.
>
> Yeah, and just to make it clear, this really becomes an issue if you
> have hundreds of thousands or even millions of tables. It's a lot of
> extra data to be writing, and in some cases we're rewriting it all,
> like, once per second.

Fair enough. At that point, a lot of things become unexpectedly painful.
How many % of the installed base may that be though?

I'm far from done reading the patch and mail thread Andres mentioned,
but I think the general idea is to move the stats to shared memory, so
that reading (and thus, persisting) pg_stats is required far less often,
right?

> Now if we're only incurring that overhead when this feature is
> enabled, then in fairness that problem is a lot less of an issue,
> especially if this is also disabled by default. People who want the
> data can get it and pay the cost, and others aren't much impacted.

That's the idea, yes. I reckon folks with millions of tables will scan
through the docs (and postgresql.conf) very thoroughly anyway. Hence the
note there.

> However, experience has taught me that a lot of skepticism is
> warranted when it comes to claims about how cheap extensions to the
> statistics system will be.

Again, fair enough!
Maybe we first need statistics about statistics collection and handling? ;-)

Best,
--
Gunnar "Nick" Bluth

Eimermacherweg 106
D-48159 Münster

Mobil +49 172 8853339
Email: gunnar(dot)bluth(at)pro-open(dot)de
__________________________________________________________________________
"Ceterum censeo SystemD esse delendam" - Cato

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-04-06 16:02:30 Re: Last day of commitfest
Previous Message Greg Stark 2022-04-06 15:57:17 Last day of commitfest