Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rHR5T-002QsB-2P for pgsql-admin@arkaria.postgresql.org; Sun, 24 Dec 2023 16:12:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rHR5R-00C64T-AW for pgsql-admin@arkaria.postgresql.org; Sun, 24 Dec 2023 16:12:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rHR5Q-00C64L-Vt for pgsql-admin@lists.postgresql.org; Sun, 24 Dec 2023 16:12:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rHR5O-00BzkJ-I3 for pgsql-admin@postgresql.org; Sun, 24 Dec 2023 16:12:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3BOGCF5p1615175; Sun, 24 Dec 2023 11:12:15 -0500 From: Tom Lane To: Murthy Nunna cc: "pgsql-admin@postgresql.org" Subject: Re: Query Performance after pg_restore In-reply-to: References: Comments: In-reply-to Murthy Nunna message dated "Sun, 24 Dec 2023 15:53:39 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1615173.1703434335.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 24 Dec 2023 11:12:15 -0500 Message-ID: <1615174.1703434335@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Murthy Nunna writes: > I did pg_dump of a ~20TB database followed by pg_restore. I find simple = queries like select count(*) running slow. I did a select count(*) on all = tables before pg_dump which took ~4 hours. After pg_restore, same thing to= ok 32 hours. My bet is that that was setting commit hint bits, and hence incurring a lot of writes. If the data is reasonably stable that's a one-time expense. regards, tom lane