From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Melanie Plageman <melanieplageman(at)gmail(dot)com> |
Cc: | Robert Treat <rob(at)xzilla(dot)net>, Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>, Alena Rybakina <a(dot)rybakina(at)postgrespro(dot)ru>, Andres Freund <andres(at)anarazel(dot)de>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Geoghegan <pg(at)bowt(dot)ie> |
Subject: | Re: Eagerly scan all-visible pages to amortize aggressive vacuum |
Date: | 2025-01-23 17:16:34 |
Message-ID: | CA+TgmoZq5dmujCq5p64fbvqRxS0UyRUZb4jdHTJHVEOXPaFtxA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Jan 22, 2025 at 5:48 PM Melanie Plageman
<melanieplageman(at)gmail(dot)com> wrote:
> Circling back to benchmarking, I've been running the most adversarial
> benchmarks I could devise and can share a bit of what I've found.
>
> I created a "hot tail" benchmark where 16 clients insert some data and
> then update some data older than what they just inserted but still
> towards the end of the relation. The adversarial part is that I bulk
> delete all the data older than X hours where X hours is always after
> the data is eligible to be frozen but before it would be aggressively
> vacuumed.
>
> That means that there are a bunch of pages that will never be frozen
> on master but are frozen with the patch -- wasting vacuum resources. I
> tuned vacuum_freeze_min_age and vacuum_freeze_table_age and picked the
> DELETE window to specifically have this behavior.
>
> With my patch, I do see a 15-20% increase in the total time spent
> vacuuming over the course of the multi-hour benchmark. (I only see a
> 1% increase in the total WAL volume, though.)
How much time is that in absolute terms? If the benchmark runs for 3
hours and during that time we have 1 autovacuum worker active for 30
minutes out of those 3 hours, that is different than if we have 5
autovacuum workers active nearly all the time. Or, maybe a clearer way
to put it, what percentage of the total work was the VACUUM work? If
the total work was $100 and the VACUUM work accounted for $80 of that,
then a 15-20% increase is pretty significant; if the total work was
$100 and the VACUUM work accounted for $5 of that, then a 15-20%
increase matters a lot less.
But tentatively I'm inclined to say this is fine. Some of the work
that VACUUM is doing is probably work that otherwise would have needed
to happen in the foreground. For instance, the speedup in DELETEs that
you observed might be not only because the pages are cached but
perhaps also because DELETE doesn't need to do any non-trivial
visibility checks. Also, users don't have to anti-optimize their
configuration settings for their workload as you did when constructing
the adversarial case.
--
Robert Haas
EDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2025-01-23 17:30:48 | Re: Wrong security context for deferred triggers? |
Previous Message | Dean Rasheed | 2025-01-23 15:46:47 | Re: [PATCH] Add get_bytes() and set_bytes() functions |