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 1elfmN-0008Uw-Lq for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Feb 2018 18:58:11 +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 1elfmM-00015P-D6 for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Feb 2018 18:58:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1elfmM-00015F-45 for pgsql-bugs@lists.postgresql.org; Tue, 13 Feb 2018 18:58:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1elfmI-0002et-PM for pgsql-bugs@postgresql.org; Tue, 13 Feb 2018 18:58:08 +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 w1DIw0X1030158; Tue, 13 Feb 2018 13:58:00 -0500 From: Tom Lane To: =?gb2312?B?yq/Twrui?= cc: pgsql-bugs@postgresql.org Subject: Re: =?gb2312?Q?=B4=F0=B8=B4:_response_time_is_very_long?= =?gb2312?Q?_in_PG9.5.5_using_psql_or_jdbc?= In-reply-to: References: <72aa8c39225549dd8c1d18f96df8b1e3@pingan.com.cn> <30153.1518488973@sss.pgh.pa.us> Comments: In-reply-to =?gb2312?B?yq/Twrui?= message dated "Tue, 13 Feb 2018 04:48:37 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30156.1518548280.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 13 Feb 2018 13:58:00 -0500 Message-ID: <30157.1518548280@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?gb2312?B?yq/Twrui?=3D writes: > Yes,we have more than 500 thousand of objects,and the total size of the = database is almost 10TB.Just as you said,we may need to reduce the objects= number,or you have any better solution? Hmph. I tried creating 500000 tables in a test database, and couldn't detect any obvious performance problem in session startup. So there's something very odd about your results. You might try looking at the sizes of the system catalogs, e.g like select pg_size_pretty(pg_total_relation_size('pg_attribute')); (In my test database, pg_class is about 80MB and pg_attribute about 800MB.) > And I also have a question that if the backend's internal caches of cata= log is shared with other users or sessions?if the pgbouncer is usefull? pgbouncer or some other connection pooler would help, yes. But I don't think the underlying performance ought to be this bad to begin with. regards, tom lane