Re: [PERFORM] Slow execution of SET ROLE, SET search_path and RESET ROLE - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: [PERFORM] Slow execution of SET ROLE, SET search_path and RESET ROLE
Date
Msg-id CAOR=d=3t=y4A+5+iuSaPWj9zgKNin=9rf9+jvR4TAB+g_tXMVA@mail.gmail.com
Whole thread Raw
In response to Re: [PERFORM] Slow execution of SET ROLE, SET search_path and RESET ROLE  (Ulf Lohbrügge <ulf.lohbruegge@gmail.com>)
Responses Re: [PERFORM] Slow execution of SET ROLE, SET search_path and RESET ROLE
List pgsql-performance
On Tue, Nov 7, 2017 at 2:25 PM, Ulf Lohbrügge <ulf.lohbruegge@gmail.com> wrote:
> 2017-11-07 20:45 GMT+01:00 Andres Freund <andres@anarazel.de>:
>>
>> On 2017-11-07 18:48:14 +0100, Ulf Lohbrügge wrote:
>> > Hi,
>> >
>> > 2017-11-07 16:11 GMT+01:00 Andres Freund <andres@anarazel.de>:
>> >
>> > > Hi,
>> > >
>> > > On 2017-11-07 11:11:36 +0100, Ulf Lohbrügge wrote:
>> > > > I'm using PostgreSQL 9.5.9 on Debian and experience slow execution
>> > > > of
>> > > some
>> > > > basic SET statements.
>> > > >
>> > > > I created about 1600 roles and use that setup for a multi tenancy
>> > > > application:
>> > >
>> > > Hm. How often do you drop/create these roles?  How many other
>> > > roles/groups is one role a member of?
>> > >
>> >
>> > I create between 10-40 roles per day.
>>
>> Could you VACUUM (VERBOSE, FREEZE) that table and report the output?  Do
>> you ever delete roles?
>
>
> Which table do you mean exactly? pg_catalog.pg_authid?
>
> Sorry, forgot to write that: I delete about 2-3 roles per day.

I'm gonna take a guess that pg_users or pg_roles has gotten bloated
over time. Try running a vacuum full on both of them. It's also
possible some other pg_xxx table is bloated out here too you might
need to download something like checkpostgres.pl to check for bloat in
system catalog tables.


--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

pgsql-performance by date:

Previous
From: Ulf Lohbrügge
Date:
Subject: Re: [PERFORM] Slow execution of SET ROLE, SET search_path and RESET ROLE
Next
From: Ulf Lohbrügge
Date:
Subject: Re: [PERFORM] Slow execution of SET ROLE, SET search_path and RESET ROLE