From: | Jeff Davis <pgsql(at)j-davis(dot)com> |
---|---|
To: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
Cc: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Robert Treat <rob(at)xzilla(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>, jian he <jian(dot)universality(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, alvherre(at)alvh(dot)no-ip(dot)org |
Subject: | Re: Statistics Import and Export |
Date: | 2025-04-03 22:23:40 |
Message-ID: | 8a6905c658ed52418c6f413393390dc43d63a995.camel@j-davis.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, 2025-04-02 at 21:26 -0500, Nathan Bossart wrote:
> Okay, here is an updated patch set.
> * Besides custom format calling WriteToc() twice to update the data
> offsets, tar format ... even if it did, the worst case is that
> the
> content of restore.sql (which isn't used by pg_restore) would be
> different. I noticed some past discussion that seems to suggest
> that
> this format might be a candidate for deprecation [0], so I'm not
> sure
> it's worth doing anything fancier.
I agree that the risk for tar format seems much lower.
> * Our batching code assumes that stats entries are dumped in TOC
> order,
>
...
> I propose moving all
> stats entries in SECTION_POST_DATA to RESTORE_PASS_POST_ACL, which
> ensures that we always dump stats in TOC order. One convenient
> side
> effect of this change is that we can revert a decent chunk of
> commit
> a0a4601765. It might be possible to do better via smarter
> lookahead code
> or a more sophisticated cache, but it's a bit late in the game for
> that.
This simplifies commit a0a4601765. I'd break out that simplification as
a separate commit to make it easier to understand what happened.
In patch 0003, there are quite a few static function-scoped variables,
which is not a style that I'm used to. One idea is to bundle them into
a struct representing the cache state (including enough information to
fetch the next batch), and have a single static variable that points to
that.
Also in 0003, the "next_te" variable is a bit confusing, because it's
actually the last TocEntry, until it's advanced to point to the current
one.
Other than that, looks good to me.
Regards,
Jeff Davis
From | Date | Subject | |
---|---|---|---|
Next Message | Devulapalli, Raghuveer | 2025-04-03 22:28:30 | RE: Improve CRC32C performance on SSE4.2 |
Previous Message | Sami Imseih | 2025-04-03 22:21:02 | Re: New criteria for autovacuum |