From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: predefined role(s) for VACUUM and ANALYZE
Date: Tue, 20 Sep 2022 21:31:26 -0700
Message-ID: <20220921043126.GA382738@nathanxps13> (raw)
In-Reply-To: <Yyppg/c4SB7s1IAv@paquier.xyz>
References: <20220907211343.GE26002@tamriel.snowman.net>
<20220907221103.GA2095022@nathanxps13>
<CAOuzzgr60X+pnVphekO=WnAwGo9pTbo9ZG_GK4nFaR=Dxqd1hg@mail.gmail.com>
<CA+TgmoaQExEDdRmQsFCd955dxCypDBeA_FOrUKCLNWAdQ69zxg@mail.gmail.com>
<20220920035147.GA114383@nathanxps13>
<YylTkIwvWuYJkMnT@paquier.xyz>
<20220920180533.GA205278@nathanxps13>
<20220920233117.GA378596@nathanxps13>
<20220920235010.GB378596@nathanxps13>
<Yyppg/c4SB7s1IAv@paquier.xyz>
On Wed, Sep 21, 2022 at 10:31:47AM +0900, Michael Paquier wrote:
> Did you just run an aclupdate()? 4% for aclitem[] sounds like quite a
> number to me :/ It may be worth looking at if these operations could
> be locally optimized more, as well. I'd like to think that we could
> live with that to free up enough bits in AclItems for the next 20
> years, anyway. Any opinions?
Yes, the test was mostly for aclupdate(). Looking at that function, I bet
most of its time is spent in palloc0() and memcpy(). It might be possible
to replace the linear search if the array was sorted, but I'm skeptical
that will help much. In the end, I'm not it's worth worrying too much
about 2,000 calls to aclupdate() with an array of 2,000 ACLs taking 5.3
seconds instead of 5.1 seconds.
I bet a more pressing concern is the calls to aclmask() since checking
privileges is probably done more frequently than updating them. That
appears to use a linear search, too, so maybe sorting the aclitem arrays is
actually worth exploring. I still doubt there will be much noticeable
impact from expanding AclMode outside of the most extreme cases.
> For the column sizes of the catalogs, I was wondering about how
> pg_column_size() changes when they hold ACL information. Unoptimized
> alignment could cause an unnecessary increase in the structure sizes,
> so the addition of new fields or changes in object size could have
> unexpected side effects.
After a few tests, I haven't discovered any changes to the output of
pg_column_size().
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
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: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, michael@paquier.xyz, robertmhaas@gmail.com, sfrost@snowman.net, bharath.rupireddyforpostgres@gmail.com, david.g.johnston@gmail.com, horikyota.ntt@gmail.com
Subject: Re: predefined role(s) for VACUUM and ANALYZE
In-Reply-To: <20220921043126.GA382738@nathanxps13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox