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 1s9TvF-002bgF-Lg for pgsql-general@arkaria.postgresql.org; Tue, 21 May 2024 18:09:15 +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 1s9TvE-00BkAB-Tm for pgsql-general@arkaria.postgresql.org; Tue, 21 May 2024 18:09:12 +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 1s9TvE-00BkA2-1X for pgsql-general@lists.postgresql.org; Tue, 21 May 2024 18:09:12 +0000 Received: from wfhigh2-smtp.messagingengine.com ([64.147.123.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9Tv6-0004fj-8x for pgsql-general@lists.postgresql.org; Tue, 21 May 2024 18:09:11 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id E9FB81800139; Tue, 21 May 2024 14:09:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 21 May 2024 14:09:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1716314940; x=1716401340; bh=CisxSUOpv3G3CI5edsuHQkg9HCR4RvHSi6aCBj0pH4c=; b= QWf9vZ4PeCPJp3JHI21neVpOu5XIR8ofFBTUGfHdwFagcn/S78CJjrILz6PchRiY NU3nDJ9iX1r11L+x9LYFNtkWyd6aDV/49gNtq3sWNthAChY2L+M+Tx7WogZjvZVU gJSKCphKOfMh0gslq5ymkIC2HBFB5jS/Chx629lFjoU1Mvk4jNrSQxjkmT1DtzLZ 6E4CpM2GpvfNlUXDLP9mqe5sSQ+RWitCnEmSvlFpjJrFA9iXTYYhWhlapyIMgBji EF7MqzDCfub/Ou7lWViWDXGXbldJiRJanocel4bTYNZDAQYwI5KitpFTRM2imAXa v/ctibsroTae+cBRwOwNmQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716314940; x= 1716401340; bh=CisxSUOpv3G3CI5edsuHQkg9HCR4RvHSi6aCBj0pH4c=; b=S c323/dahhmq7nrQ5V2OPodduvjgXy567rYFh6gs66p65Pqws6C9h6eau7e2Rd/Bj x/hORdXtVsY+GO0LpVqUscJ6hzwyfRGvEIGDnlfkFfS39xyyEhzkyRwLw7B5cCri EGp3mtZxTQi8EaK1ZbhGPy09+RBPOiNfTe6mLeltwyqW2hZMzWCZ7pfFzSM44hll buZNxp+K5KyaKKO/1Pow9W0Kxr9vP5c6iZ80VKkpild7x5JCEd8kcSG0ama6HmYU UazwLPMQzBbuMnvOgx39NpTLzpnspIuAI23H20RdpuiWYKaOU/SgbtM6eAfRhLvY jPzeD9Z0XG65BqjF6YNEA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeivddguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepiedvhfeiheehgeeuieeljeeitedtjeehudegfeel kedvleekhedtgfeiffefkedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 May 2024 14:08:59 -0400 (EDT) Message-ID: <27914bc8-f12a-4f28-b4eb-0730f5dcfb0c@aklaver.com> Date: Tue, 21 May 2024 11:08:57 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Restore of a reference database kills the auto analyze processing. To: HORDER Philip , "pgsql-general@lists.postgresql.org" References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 5/21/24 9:29 AM, HORDER Philip wrote: > Classified as: {OPEN} > >> I am having a hard time figuring out how both of the above can be true. >> Dropping and recreating the database would wipe out the statistics. > > We have multiple databases on the one Postgres server. > The 'postgres' database contains our main application, with tables in schema 'a'. > We have two other databases, one of which is 'lfm'. > > In PgAdmin, there is Databases (3), then those database names. > As the superuser, I can connect to any of these databases. > > When we drop database lfm, and recreate it using pg_restore, the stats collection dies, for all databases on the server: 'postgres', 'lfm', 'lfm2' > I haven't dropped database 'postgres' > > So the existing stats on tables in the 'postgres' database remain, but no further stats are collected. From int-postgres-log-21-05-2024.txt: 2024-05-15 03:31:31.290 GMT [4556]: [3-1] db=lfm,user=superuser,app=[unknown],client=::1 LOG: connection authorized: user=superuser database=lfm application_name=pg_restore That would be the lfm database being restored. What does the log show after that as pertains to autovacuum? > > Phil Horder > Database Mechanic > > Thales > Land & Air Systems > > > {OPEN} > The information contained in this e-mail is confidential. It is intended only for the stated addressee(s) and access to it by any other person is unauthorised. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this e-mail. Such unauthorised use may be unlawful. If you have received this e-mail in error, please inform the originator immediately and delete it and all copies from your system. > > Thales UK Limited. A company registered in England and Wales. Registered Office: 350 Longwater Avenue, Green Park, Reading, Berks RG2 6GF. Registered Number: 868273 > > Please consider the environment before printing a hard copy of this e-mail. -- Adrian Klaver adrian.klaver@aklaver.com