=?UTF-8?Q?Ulf_Lohbr=C3=BCgge?= <ulf(dot)lohbruegge(at)gmail(dot)com> 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 first query executed in a *session* takes
a pretty big performance hit, because of the need to populate the
backend's catalog caches. I'm not very sure however why "RESET ROLE"
would result in a mass cache flush, if indeed that's what's happening.
regards, tom lane