pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>
To: David Gould <daveg@sonic.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: 石勇虎 <SHIYONGHU651@pingan.com.cn>
Cc: pgsql-bugs@postgresql.org
Subject: Re: response time is very long in PG9.5.5 using psql or jdbc
Date: Wed, 14 Feb 2018 00:53:21 +0100
Message-ID: <0bac4aab-8bbf-fefd-b66c-5d87308adabc@2ndquadrant.com> (raw)
In-Reply-To: <20180213213110.5ip4hsnu2hjz52ae@alap3.anarazel.de>
References: <72aa8c39225549dd8c1d18f96df8b1e3@pingan.com.cn>
	<30153.1518488973@sss.pgh.pa.us>
	<a82e97e75d05417da514e2c82dd8fb51@pingan.com.cn>
	<30157.1518548280@sss.pgh.pa.us>
	<20180213132447.0a26f00c@engels>
	<20180213213110.5ip4hsnu2hjz52ae@alap3.anarazel.de>



On 02/13/2018 10:31 PM, Andres Freund wrote:
> Hi,
> 
> On 2018-02-13 13:24:47 -0800, David Gould wrote:
>> I see this problem fairly frequently. Typically the problem catalog is
>> pg_attribute as it has the most rows. However the problem really arises when
>> the catalogs become bloated. Once the total size of the catalogs that get
>> read at start up approaches the size of shared buffers, and especially if
>> several processes start at the same time, it becomes quite noticeable.
> 
> I can obviously see problems with a bloated catalog, but how does that
> cause massive slowdowns in *individual* queries as we see here?  The
> OP's problem isn't the connection establishment performance afaict, but
> the first query using specific pieces of catalog data. And that should
> be ok-ish performancewise, even if there's bloat.
> 

What if the first connection does not actually go to PostgreSQL, but to
some sort of connection pool (like pgbouncer)? That would be consistent
with the observed behavior, I think - the first connection would likely
have to open connection to a backend, paying all the price.

Obviously, this is just a stab in the dark ...


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (11+ messages)  latest in thread

Message-ID: <0bac4aab-8bbf-fefd-b66c-5d87308adabc@2ndquadrant.com>
Permalink:  ../0bac4aab-8bbf-fefd-b66c-5d87308adabc@2ndquadrant.com/
Also on:    postgresql.org/message-id/0bac4aab-8bbf-fefd-b66c-5d87308adabc@2ndquadrant.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-bugs@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, andres@anarazel.de, daveg@sonic.net, tgl@sss.pgh.pa.us, SHIYONGHU651@pingan.com.cn
  Subject: Re: response time is very long in PG9.5.5 using psql or jdbc
  In-Reply-To: <0bac4aab-8bbf-fefd-b66c-5d87308adabc@2ndquadrant.com>
  References: <72aa8c39225549dd8c1d18f96df8b1e3@pingan.com.cn> <30153.1518488973@sss.pgh.pa.us> <a82e97e75d05417da514e2c82dd8fb51@pingan.com.cn> <30157.1518548280@sss.pgh.pa.us> <20180213132447.0a26f00c@engels> <20180213213110.5ip4hsnu2hjz52ae@alap3.anarazel.de> <0bac4aab-8bbf-fefd-b66c-5d87308adabc@2ndquadrant.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