pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Maksim Milyutin <milyutinma@gmail.com>
To: Vadim Nevorotin <nevorotin@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: First query on each connection is too slow
Date: Wed, 13 Jun 2018 13:34:32 +0300
Message-ID: <70a1988a-4ec0-09e2-b31c-4abf4c6d2e2f@gmail.com> (raw)
In-Reply-To: <CAF=tNg_eEVo79iAYrs_MqLQc_qWnOv8dtf_Vz+_0o=icKfkntw@mail.gmail.com>
References: <CAF=tNg_eEVo79iAYrs_MqLQc_qWnOv8dtf_Vz+_0o=icKfkntw@mail.gmail.com>

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 time: 2.589 ms
>  Execution time: 49.467 ms*
>
> (45 rows)
>
> And there are two questions: why this problem occurs and how can I fix it?

You could catch a performance profile of this issue using perf tools and 
iterative executing this query in new sessions via pgbench, for example. 
This would greatly facilitate the search for the cause of your problem.

-- 
Regards,
Maksim Milyutin

view thread (11+ messages)  latest in thread

Message-ID: <70a1988a-4ec0-09e2-b31c-4abf4c6d2e2f@gmail.com>
Permalink:  ../70a1988a-4ec0-09e2-b31c-4abf4c6d2e2f@gmail.com/
Also on:    postgresql.org/message-id/70a1988a-4ec0-09e2-b31c-4abf4c6d2e2f@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: milyutinma@gmail.com, nevorotin@gmail.com
  Subject: Re: First query on each connection is too slow
  In-Reply-To: <70a1988a-4ec0-09e2-b31c-4abf4c6d2e2f@gmail.com>
  References: <CAF=tNg_eEVo79iAYrs_MqLQc_qWnOv8dtf_Vz+_0o=icKfkntw@mail.gmail.com> <70a1988a-4ec0-09e2-b31c-4abf4c6d2e2f@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox