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 1rprv8-0099xp-Nk for pgsql-novice@arkaria.postgresql.org; Thu, 28 Mar 2024 15:44:03 +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 1rprv7-00GEHN-EH for pgsql-novice@arkaria.postgresql.org; Thu, 28 Mar 2024 15:44:01 +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 1rprv7-00GEHF-4q for pgsql-novice@lists.postgresql.org; Thu, 28 Mar 2024 15:44:01 +0000 Received: from mail.icsusa.com ([50.200.139.225]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rprv0-0071Aa-A8 for pgsql-novice@lists.postgresql.org; Thu, 28 Mar 2024 15:44:00 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.icsusa.com (Postfix) with ESMTP id 40B7741174A9F for ; Thu, 28 Mar 2024 10:43:58 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icsusa.com; h= x-mailer:date:date:message-id:subject:subject:mime-version :reply-to:content-type:content-type:from:from:received:received; s=default; t=1711640638; x=1713455039; bh=T7hIJuQZ/PwNAj0TlUt9p HHXWyN8Qcq7tohijEMVgd4=; b=wtmPcl3jW85gEyHp253IzRL0WoB4BRf0ifnxn SSJcoEsQ3y9ympdRQmUlgu0WNaLKW298GebI3fP2baOI1pNCqw2xl5qiQAT4SDwK QQC1qeQfyyEsGZcjf0Zwpu/pnckVKB/DmIJ9G/3hInWzhVZpw070zhtJSRc1UTe0 XIeDCk= X-Virus-Scanned: amavisd-new at icsusa.com Received: from mail.icsusa.com ([127.0.0.1]) by localhost (mail.icsusa.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PGcuCejbYsve for ; Thu, 28 Mar 2024 10:43:58 -0500 (CDT) Received: from smtpclient.apple (c-73-37-172-188.hsd1.mn.comcast.net [73.37.172.188]) by mail.icsusa.com (Postfix) with ESMTPSA id 17E5241174A8D for ; Thu, 28 Mar 2024 10:43:58 -0500 (CDT) From: David Fogarty Content-Type: multipart/alternative; boundary="Apple-Mail=_D73758C6-7D86-421B-B6DD-82011F630366" Reply-To: David Fogarty Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Performance after restart/reboot pre-Analyze Message-Id: <6F39634B-20B1-4683-9320-C4D7B68D53CF@icsusa.com> Date: Thu, 28 Mar 2024 10:43:37 -0500 To: pgsql-novice@lists.postgresql.org X-Mailer: Apple Mail (2.3774.500.171.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_D73758C6-7D86-421B-B6DD-82011F630366 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello, 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 = query planner needing new stats, but that leads me to three questions: 1. Is there a way to have Analyze stats/query planner "plans" persist = through a restart? Like store them somehow after an Analyze and tell = Postgres where to pull them from? 2. If not, is there a technical reason/limitation as to why? 3. Are there general configuration settings/optimizations for improving = performance after a restart before an Analyze has finished? If this would be better directed toward a different mailing list, let me = know. I appreciate any guidance on this. Also, if it affects anything, the environments are on AWS RDS, we're = currently on 14 and 15 but will be upgrading to 16 very soon. I've only = recently been brought into this, so I'm not fully aware of what kinds of = queries we mostly handle or how the various tables/views are indexed. Thanks, Dave --Apple-Mail=_D73758C6-7D86-421B-B6DD-82011F630366 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

Hello,

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 query planner needing new stats, but that = leads me to three questions:

1. Is there a way = to have Analyze stats/query planner "plans" persist through a restart? = Like store them somehow after an Analyze and tell Postgres where to pull = them from?

2. If not, is there a technical = reason/limitation as to why?

3. Are there = general configuration settings/optimizations for improving performance = after a restart before an Analyze has = finished?

If this would be better directed = toward a different mailing list, let me know. I appreciate any guidance = on this.
Also, if it affects anything, the environments are on = AWS RDS, we're currently on 14 and 15 but will be upgrading to 16 very = soon. I've only recently been brought into this, so I'm not fully aware = of what kinds of queries we mostly handle or how the various = tables/views are = indexed.

Thanks,
Dave

= --Apple-Mail=_D73758C6-7D86-421B-B6DD-82011F630366--