Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: alex work <alexwork033(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs
Date: 2024-03-21 07:59:29
Message-ID: CAFCRh-_w4sRJ12X05Qojf=1_w_EBP_Gq33Vsa6hSpev_hEpvsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, Mar 21, 2024 at 8:10 AM alex work <alexwork033(at)gmail(dot)com> wrote:

> We encounter slow `GRANT ROLES` only on PostgreSQL 16 instances up to 42
> seconds
> in production, the client process at PostgresSQL would use 100% of the
> CPU. [...]
>
Using ROLE `acc`, grant `d_` ROLE to a session ROLE:
> real 0m7.579s [...]

PostgreSQL 15
> Using ROLE `acc`, grant `d_` ROLE to a session ROLE:
> real 0m0.077s
>

Ouch, that's a ~ 100x regression. Thanks for the write-up, that's worrying.
We don't have as many ROLEs, but we do have plenty, so this is worrying.

On top of the v16 ROLE changes breaking on ROLE logic, which was fine prior
(v12-v15).
We've paused for now our planned v16 upgrade, until we have more time to
adapt.

Like you, I welcome the changes. But it turns out more expensive to adapt
to them.
And your report certainly makes me wonder whether we should hold off until
that perf regression is addressed.

Thanks, --DD

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joseph Kennedy 2024-03-21 09:48:55 Question about PostgreSQL upgrade from version 12 to version 15
Previous Message alex work 2024-03-21 07:10:06 Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2024-03-21 08:16:32 Re: Inconsistent printf placeholders
Previous Message Peter Eisentraut 2024-03-21 07:56:53 Re: Trying to build x86 version on windows using meson