Re: Performance after restart/reboot pre-Analyze - Mailing list pgsql-novice

From David G. Johnston
Subject Re: Performance after restart/reboot pre-Analyze
Date
Msg-id CAKFQuwZEcn9512o=Zgh_SsWnO0VcYU7-t4SZypJTY=AqtVwk9w@mail.gmail.com
Whole thread Raw
In response to [MASSMAIL]Performance after restart/reboot pre-Analyze  (David Fogarty <dfogarty@icsusa.com>)
List pgsql-novice
On Thu, Mar 28, 2024 at 8:44 AM David Fogarty <dfogarty@icsusa.com> wrote:

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,

Nope, statistics are WAL logged.
 
but that leads me to three questions:

1. Is there a way to have Analyze stats/query planner "plans" persist through a restart?

Plans are session-scoped.

What you are observing is the shared buffers being empty.  There is a contrib library, pg_prewarm, designed to help alleviate this problem.


David J.

pgsql-novice by date:

Previous
From: David Fogarty
Date:
Subject: [MASSMAIL]Performance after restart/reboot pre-Analyze
Next
From: Tom Lane
Date:
Subject: Re: Performance after restart/reboot pre-Analyze