Do you really need to query the catalogues ? That on its own is not a good idea if you want something to run fast and frequently. -- GJ
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных