Re: High CPU Usage of "SET ROLE"

2018-10-30 Thread Jeff Janes
On Tue, Oct 30, 2018 at 3:50 PM Ulf Lohbrügge wrote: > When I use the psql cli on the same database I can see via "\timing" that > the first statement after "RESET ROLE;" is significantly slower. I was even > able to strip it down to two statements ("SET ROLE ...;" and "RESET ROLE;"): > > ... >

Re: High CPU Usage of "SET ROLE"

2018-10-30 Thread Tom Lane
=?UTF-8?Q?Ulf_Lohbr=C3=BCgge?= writes: > I think I have found something here. It looks like that the order of > statements is affecting their duration. I somehow have the feeling that the > first statement after "RESET ROLE;" experiences a performance degradation. Hm. It's well known that the fi

Re: High CPU Usage of "SET ROLE"

2018-10-30 Thread Ulf Lohbrügge
> > It seems plausible to guess that you've hit some behavior that's O(N^2) > in the number of objects (for some object type or other). Perhaps "perf" > or a similar tool would give some insight into where the bottleneck is. > > https://wiki.postgresql.org/wiki/Profiling_with_perf Thanks for you

Re: High CPU Usage of "SET ROLE"

2018-10-22 Thread Tom Lane
=?UTF-8?Q?Ulf_Lohbr=C3=BCgge?= writes: > I'm running PostgreSQL 9.6.10 on Debian and reported some performance > issues with "SET ROLE" a while ago: > https://www.postgresql.org/message-id/CABZYQR%2BKu%2BiLFhqwY89QrrnKG9wKxckmssDG2rYKESojiohRgQ%40mail.gmail.com > ... > The setup is the same as rep