public inbox for [email protected]
help / color / mirror / Atom feedFrom: Michael Paquier <[email protected]>
To: CharSyam <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] Reduce pg_class scans in GRANT/REVOKE ON ALL TABLES IN SCHEMA
Date: Mon, 13 Apr 2026 09:43:00 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAMrLSE7bZ70eGaTMH3-g=TA_sfp3kTDOrHVNYw1=1XL9krapqQ@mail.gmail.com>
References: <CAMrLSE7bZ70eGaTMH3-g=TA_sfp3kTDOrHVNYw1=1XL9krapqQ@mail.gmail.com>
On Sun, Apr 12, 2026 at 04:22:24PM +0900, CharSyam wrote:
> Benchmark
> ---------
> This is a targeted micro-optimization, not a dramatic speedup.
> With 10,000 tables in a single schema (pg_class ~10,452 rows),
> running GRANT/REVOKE SELECT ON ALL TABLES IN SCHEMA in a loop
> (6 iterations, first dropped as warmup), I measured a consistent
> ~15% reduction in end-to-end time:
>
> baseline patched delta
> GRANT (avg) 88.2 ms 75.9 ms -14%
> REVOKE (avg) 134.9 ms 115.7 ms -14%
I am pretty sure that there are users with millions of relations in a
single schema that could benefit from that. At least that would not
be surprising with partitioning these days, and foreign tables. What
kind of numbers do you get if you bump up the number of digits for
these tests. Let's say a comparison based on a few million relations
at least?
The change you are proposing looks simple enough, quickly skimming
through the patch. There may be more optimizations doable here, I
have not looked at that, still I tend to like such micro-optimization
proposals as they provide a silent benefit.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (833B, 2-signature.asc)
download
view thread (3+ 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]
Subject: Re: [PATCH] Reduce pg_class scans in GRANT/REVOKE ON ALL TABLES IN SCHEMA
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