public inbox for [email protected]
help / color / mirror / Atom feedFrom: Jeff Davis <[email protected]>
To: Corey Huinker <[email protected]>
To: jian he <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Matthias van de Meent <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Magnus Hagander <[email protected]>
Cc: Stephen Frost <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: [email protected]
Cc: MichaelPaquier <[email protected]>
Subject: Re: Statistics Import and Export
Date: Wed, 05 Feb 2025 20:45:06 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CADkLM=cnYxaNFbAQRMLeOOga0j5pY_V6Tfcn+vjm_rXL=WOF7Q@mail.gmail.com>
References: <CADkLM=cxNaU3O40Y5zGARJBWm-uAvb2hvgZxd=tOu-zTsrHpkQ@mail.gmail.com>
<[email protected]>
<CADkLM=fcAneLoFrd41zdxm_1mMZz+wTp5gLJ=Av5JtBi5cBnDQ@mail.gmail.com>
<[email protected]>
<CADkLM=fyJ-Y-DNk1aW09btZYdXDXS79xT8oFPTQ6sspWHaqdog@mail.gmail.com>
<[email protected]>
<CADkLM=cWc+Zbjnpew9sg346DdRQJj8OSvZjg4fwvpLH10EViJQ@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<Z3xKtmHxPpHNyqfH@nathan>
<CADkLM=c6NHdXU+d+m1yASZ4NT_qye1LCnaU2Vgf8YJ80jJT-Qg@mail.gmail.com>
<[email protected]>
<CADkLM=fe4f=YVGHbOGiXV+W2SoJZtcNw1Ta8gYh5UUhxndaVgw@mail.gmail.com>
<CACJufxGuRPfd70NwogkRE26cZcKGrR9gjG4OiH18tu=BnyezHA@mail.gmail.com>
<CADkLM=fMuVwcxr2aocz4H=LVf2PZsvTNenqEod2PoY1OyCU+kw@mail.gmail.com>
<[email protected]>
<CADkLM=cQi+sYpLY6BqybZ8ZWffSU4+1-aEQsShSGbrh3M=Dtcg@mail.gmail.com>
<[email protected]>
<CACJufxG6K4EAUROhdr0wkzMh5QyFLmdLZeAoh7Vh0-VbuAtHcw@mail.gmail.com>
<CADkLM=fihosVw7fJak6Jq1AdCX8fuZ+7s1_-+AUZR=sdD13zAQ@mail.gmail.com>
<CADkLM=cnYxaNFbAQRMLeOOga0j5pY_V6Tfcn+vjm_rXL=WOF7Q@mail.gmail.com>
On Wed, 2025-02-05 at 23:01 -0500, Corey Huinker wrote:
> And here's an update to the pg_dump code itself. This currently has
> failing TAP tests for statistics in the custom and dir formats, but
> is working otherwise.
This thread got slightly mixed up, so I'm replying to the v45-0001
posted here, and also in response to Michael's and Corey's comments
from:
https://www.postgresql.org/message-id/Z5H0iRaJc1wnDVLE%40paquier.xyz
On Thu, 2025-01-23 at 16:49 +0900, Michael Paquier wrote:
> On Tue, Jan 21, 2025 at 10:21:51PM -0500, Corey Huinker wrote:
> > After some research, I think that we should treat partitioned
> > indexes like
> > we were before, and just handle the existing special case for
> > regular
> > indexes.
>
> Hmm, why? Sounds strange to me to not have the same locking
> semantics
> for the partitioned parts, and this even if partitioned indexes don't
> have stats that can be manipulated in relation_stats.c as far as I
> can see. These stats APIs are designed to be permissive as Jeff
> says.
> Having a better locking from the start makes the whole picture more
> consistent, while opening the door for actually setting real stat
> numbers for partitioned indexes (if some make sense, at some point)?
v45-0001 addresses this by locking both the partitioned index, as well
as its table, in ShareUpdateExclusive mode. That satisfies the in-place
update requirement to take a ShareUpdateExclusiveLock on the
partitioned index, while otherwise being the same as normal indexes
(and therefore unlikely to cause a problem if ANALYZE sets stats on
partitioned indexes in the future).
That means:
* For indexes: ShareUpdateExclusiveLock on table and AccessShareLock
on index
* For partitioned indexes: ShareUpdateExclusiveLock on table and
ShareUpdateExclusiveLock on index
* Otherwise, ShareupdateExclusiveLock on the relation
which makes sense to me. The v45-0001 patch itself could use some
cleanup, but I can take care of that at commit time if we agree on the
locking scheme.
Regards,
Jeff Davis
view thread (60+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Statistics Import and Export
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox