Re: First query on each connection is too slow

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: First query on each connection is too slow
Дата
Msg-id e070c4af-9cd7-c9ac-9c53-887a508c1074@gmx.net
обсуждение исходный текст
Ответ на First query on each connection is too slow  (Vadim Nevorotin <nevorotin@gmail.com>)
Список pgsql-general
Vadim Nevorotin schrieb am 13.06.2018 um 11:55:
> I have a very strange problem. I'm using PostgreSQL 9.6 with PostGIS
> 2.3 (both from Debian Strecth repos) to store DB for OSM server (but
> actually it doesn't matter). And I've noticed, that on each new
> connection to DB first query is much slower (10x) than all others.
> E.g.:
> 
> If I run others instances of psql in parallel, when the first is
> active - they has absolutely the same problem. In one instance of
> psql query is fast (if it's not the first query), in others - first
> query is slow, but all others is fast.

Do you have many(!) tables and schemas? 

Caching of schema information is done per connection, so maybe the 
lookup of the table in the system catalogs is what is taking so much time.

But I think you would need thousands of schemas with thousands of tables 
each schema in order to notice an impact there. 





В списке pgsql-general по дате отправления:

Предыдущее
От: pavan95
Дата:
Сообщение: Re: [External] Merging two database dumps
Следующее
От: "Alex O'Ree"
Дата:
Сообщение: Re: Merging two database dumps