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 1eljCZ-0002gQ-4R for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Feb 2018 22:37:27 +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 1eljCX-0001aj-Vi for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Feb 2018 22:37:25 +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 1eljCX-0001aW-Pm for pgsql-bugs@lists.postgresql.org; Tue, 13 Feb 2018 22:37:25 +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 1eljCQ-0000mj-Q8 for pgsql-bugs@postgresql.org; Tue, 13 Feb 2018 22:37:25 +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 w1DMb9H5009030; Tue, 13 Feb 2018 17:37:10 -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: <20180213222102.ku2o3oy3tvasn3hx@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> <7656.1518559596@sss.pgh.pa.us> <20180213222102.ku2o3oy3tvasn3hx@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 13 Feb 2018 14:21:02 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9028.1518561429.1@sss.pgh.pa.us> Date: Tue, 13 Feb 2018 17:37:09 -0500 Message-ID: <9029.1518561429@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > One of the OP's examples shows the connection establishment separate > from the slowdown however. Shouldn't that preclude relcache init file > rebuilds being involved? Hmm ... I was thinking that psql might be able to produce a prompt before the connected backend was done initializing, but after a bit more poking into the code that seems unlikely. Still, it might be interesting to verify whether the first command is fast if it's one that requires no catalog access. Maybe "set enable_hashjoin = 1" or suchlike (being careful not to invoke tab completion to type it ;-)). regards, tom lane