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 1ts1VO-00DKzQ-Ot for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Mar 2025 15:26:54 +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 1ts1VN-000vJu-4p for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Mar 2025 15:26:53 +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 1ts1VM-000vJm-RD for pgsql-hackers@lists.postgresql.org; Tue, 11 Mar 2025 15:26:52 +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.96) (envelope-from ) id 1ts1VF-002GCE-2k for pgsql-hackers@postgresql.org; Tue, 11 Mar 2025 15:26:52 +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 52BFQir01500727; Tue, 11 Mar 2025 11:26:44 -0400 From: Tom Lane To: Jeff Davis cc: Ashutosh Bapat , pgsql-hackers , Corey Huinker Subject: Re: Statistics import and export: difference in statistics of materialized view dumped In-reply-to: References: <1427602.1741702648@sss.pgh.pa.us> Comments: In-reply-to Jeff Davis message dated "Tue, 11 Mar 2025 08:21:43 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1500725.1741706804.1@sss.pgh.pa.us> Date: Tue, 11 Mar 2025 11:26:44 -0400 Message-ID: <1500726.1741706804@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis writes: > On Tue, 2025-03-11 at 10:17 -0400, Tom Lane wrote: >> Are you doing the restore in parallel by any chance? I had a todo >> item to revisit the dependencies that pg_dump is creating for stats >> items, because they looked wrong to me, ie inadequate to guarantee >> correct restore order. > It's creating a dependency on the relation and a boundary dependency on > the postDataBound (unless it's an index, or an MV that got pushed to > SECTION_POST_DATA). > I suspect what we need here is a dependency on the MV *data*, because > that's doing a heap swap, which resets the stats. Looking into it. Right, that was what I was thinking, but hadn't had time to look in detail. The postDataBound dependency isn't real helpful here, we could lose that if we had the data dependency. regards, tom lane