Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eliix-0001Ao-Qw for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Feb 2018 22:06:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eliiw-00040g-Jd for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Feb 2018 22:06:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eliiw-00040W-Dn for pgsql-bugs@lists.postgresql.org; Tue, 13 Feb 2018 22:06:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eliis-00007M-P3 for pgsql-bugs@postgresql.org; Tue, 13 Feb 2018 22:06:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1DM6aKK007657; Tue, 13 Feb 2018 17:06:36 -0500 From: Tom Lane To: Andres Freund cc: David Gould , =?utf-8?B?55+z5YuH6JmO?= , pgsql-bugs@postgresql.org Subject: Re: response time is very long in PG9.5.5 using psql or jdbc In-reply-to: <20180213213110.5ip4hsnu2hjz52ae@alap3.anarazel.de> References: <72aa8c39225549dd8c1d18f96df8b1e3@pingan.com.cn> <30153.1518488973@sss.pgh.pa.us> <30157.1518548280@sss.pgh.pa.us> <20180213132447.0a26f00c@engels> <20180213213110.5ip4hsnu2hjz52ae@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 13 Feb 2018 13:31:10 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7655.1518559596.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 13 Feb 2018 17:06:36 -0500 Message-ID: <7656.1518559596@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > 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. Yeah, I'm confused about it too. I'm wondering if there's some as-yet-unrecognized effect like the ones discussed here: https://www.postgresql.org/message-id/flat/4F9AC452.3050102%40pgexperts.co= m and here: https://www.postgresql.org/message-id/flat/20120524173325.GA5533%40tinybir= d.home Now, those issues seemed to be associated with needing to rebuild the relcache init file, so you wouldn't expect them to repeat on every connection ... but maybe the OP has something going on that causes the init file to get invalidated constantly. That'd have to be on top of some other massive performance problem, but at least you could see how catalog bloat could possibly lead to this type of symptom, seeing that init file rebuild requires some catalog seqscans. regards, tom lane