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 1rps3t-009B5w-D2 for pgsql-novice@arkaria.postgresql.org; Thu, 28 Mar 2024 15:53:05 +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 1rps3s-00GVJr-9o for pgsql-novice@arkaria.postgresql.org; Thu, 28 Mar 2024 15:53:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rps3s-00GVFx-1A for pgsql-novice@lists.postgresql.org; Thu, 28 Mar 2024 15:53:04 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rps3o-0071G1-Fa for pgsql-novice@lists.postgresql.org; Thu, 28 Mar 2024 15:53:02 +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 42SFqxwG3584164; Thu, 28 Mar 2024 11:52:59 -0400 From: Tom Lane To: David Fogarty cc: pgsql-novice@lists.postgresql.org Subject: Re: Performance after restart/reboot pre-Analyze In-reply-to: <6F39634B-20B1-4683-9320-C4D7B68D53CF@icsusa.com> References: <6F39634B-20B1-4683-9320-C4D7B68D53CF@icsusa.com> Comments: In-reply-to David Fogarty message dated "Thu, 28 Mar 2024 10:43:37 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3584162.1711641179.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 28 Mar 2024 11:52:59 -0400 Message-ID: <3584163.1711641179@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Fogarty writes: > It seems like whenever I restart my database server performance is quite= bad until an Analyze has been performed. I expect this is due to the quer= y planner needing new stats, but that leads me to three questions: A simple restart shouldn't invalidate statistics. I'd lay some small change on your actual problem being not that, but the need to repopulate the server's buffers from disk files. If so, pg_prewarm might help you. regards, tom lane