A possible explanation is that something is taking an exclusive lock on some system catalog and holding it for a second or two. If so, turning on log_lock_waits might provide some useful info.
regards, tom lane
I just checked my configuration and found out that "log_lock_waits" was already enabled.
Unfortunately there is no log output of locks when those long running "SET ROLE" statements occur.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.