Re: First query on each connection is too slow

2018-06-13 Thread Andres Freund
Hi, On 2018-06-13 10:49:39 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2018-06-13 12:55:27 +0300, Vadim Nevorotin wrote: > >> 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 d

Re: First query on each connection is too slow

2018-06-13 Thread pavan95
Hi Andres, Please find the below link: Link: http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server#shared_buffers Regards, Pavan -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f18437

Re: First query on each connection is too slow

2018-06-13 Thread Tom Lane
Andres Freund writes: > On 2018-06-13 12:55:27 +0300, Vadim Nevorotin wrote: >> 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

Re: First query on each connection is too slow

2018-06-13 Thread Andres Freund
Hi, On 2018-06-13 12:55:27 +0300, Vadim Nevorotin wrote: > 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

Re: First query on each connection is too slow

2018-06-13 Thread Andres Freund
Hi, On 2018-06-13 15:55:05 +0530, Pavan Teja wrote: > Too much of shared buffers allocation also causes problem. Read the > documentation. That's not in the docs. - Andres

Re: First query on each connection is too slow

2018-06-13 Thread Adrian Klaver
On 06/13/2018 02:55 AM, Vadim Nevorotin wrote: 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 (1

Re: First query on each connection is too slow

2018-06-13 Thread Thomas Kellerer
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 slow

Re: First query on each connection is too slow

2018-06-13 Thread Vadim Nevorotin
ср, 13 июн. 2018 г. в 13:25, Pavan Teja : > Too much of shared buffers allocation also causes problem. Read the > documentation. > As I noticed ahead - it's not a shared buffers or memory problem, because it appears only on first query in each new connection, even if all data already loaded to ca

Re: First query on each connection is too slow

2018-06-13 Thread Maksim Milyutin
On 13.06.2018 12:55, Vadim Nevorotin wrote: Nested Loop Left Join  (cost=0.82..26.41 rows=1 width=4) *(actual time=49.290..49.297 rows=1 loops=1)*    Join Filter: ((s_2.connamespace = n.oid) AND (s_2.conrelid = c.oid) AND (a.attnum = ANY (s_2.conkey)))    Buffers: shared hit=18 ... * Planning

Re: First query on each connection is too slow

2018-06-13 Thread Pavan Teja
Hi Vadim, Too much of shared buffers allocation also causes problem. Read the documentation. Regards, Pavan On Wed, Jun 13, 2018, 3:23 PM Vadim Nevorotin wrote: > 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 se

First query on each connection is too slow

2018-06-13 Thread Vadim Nevorotin
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.: $ psql test_gis psql (9