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 1ts1QU-00DKCe-Vh for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Mar 2025 15:21:51 +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 1ts1QT-000omF-Ae for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Mar 2025 15:21:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ts1QS-000om7-TH for pgsql-hackers@lists.postgresql.org; Tue, 11 Mar 2025 15:21:49 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ts1QP-002FSM-39 for pgsql-hackers@postgresql.org; Tue, 11 Mar 2025 15:21:47 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-22438c356c8so72352095ad.1 for ; Tue, 11 Mar 2025 08:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1741706505; x=1742311305; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=ECSZxD8p+L29HwP2BoON4xo5GArQvyIKwfhozw0COmw=; b=BHwF3nM0kopoIVYM+pGrsqo0dGCvlbhEBScVm/AMBYaHNlihag8vHRjWk9MoTCGZyE Yg9wBzgrp8+8BUUla6vFNbqjFPAzxYhSpbn/Rfhi08ejYRHaHrZmWKl6hIRdKZS+Byth BdJhHAdoq1+FAkHRoO7eUg4vrmQvgYvEiH03iXSRlqSZP4BScpBg8FpnwtBdQAGd4OaX SYCPBmBg0rudBVqLa1OVqXkTA0arq4c7hxdaFiMEeIE0JEKFqEa36vY7cO0c3rsTXjhL jXE9/BQstK29KJBBpDy33VDRPMk48gtSGzdm2UC7dFfEfFPV8WkzgR5VI9wCFBsz9a5n fdSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741706505; x=1742311305; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ECSZxD8p+L29HwP2BoON4xo5GArQvyIKwfhozw0COmw=; b=EDHEvV32dfoPbdO3rvFpcKE3txiJdDqES7YWhRgMfBY/ZWeQjIaefEsrGsxf90ED9l fTTcVvCeXk5UKtaOF4QWy+5cn9tcTWSFO5BaB2I69FDdeAdtfM8yFFczlDaFklfuotmf meqd7OkJdH5PYXwmFNf9BMM/noh+cBusksJO2u0vIX4di/R7x/4rtxxKmp/8bdhl21FZ 07OxEfAm3LNILSUt1SWVsfWZtYh8V6pn2eoF2dIJBkyh21IBc1XQ+yZfWYASPrfEDdn5 MHuoT6CyGPMJVQPm/PTCOheF0kccOlLxyjdzfVCRtL7Fh2s6Sf+uF2OSgCfB2dOCPTZk e3ig== X-Gm-Message-State: AOJu0YxiQpUxTFQ+CG123Aq632aN6LwYF6lW9zzcnqHShVHoNUM/4WS7 c0TbNcuzobWQH4tyNUU/0TaE6axPAvlCQxHn4UGWNeYqmJlTVtyQOHdgzErqtQ== X-Gm-Gg: ASbGnctcMqqZ1585yZYUH3DNTu1Wt5jyZCgsb0E+FoNFyUlBz8kMI6s8uchK2dzcPEm ysfEpVZZVWcx3Z8Dw55+hCPlboCFdHEhTOT9w1texr47v23ND5Rgjjyg6M9MFO9bFQi5uNVNSVq d7UIDSvnC6CQCinH3+5vlATvUZkitJ4cCACtD4XbXTdWhGf3PUcAKOmruJPWALf54c5nhTsldO8 /TIUaVXVzSsy+ITshcAKiskraL7HIMm2LOpodxctxh0G8i430COhQCcEsd58l3K1DSLMXZZ/4X9 0ddGSEVxLiZn4fz84vx74FvjFYSHuS7b3uerrg2xlNsF6prIuhmBI5cPZB0Ww0ZIP4993Gfa5ej hJ+4EcWcwq54h/c5dYOKitA== X-Google-Smtp-Source: AGHT+IGfuSoQsxn1bBkna05BMY7AT4o/uCs5Di0znthMpsdrc1E5oR8Hh0qwTYHhwYLM1I8SC8B2sA== X-Received: by 2002:a17:902:e80e:b0:223:669f:ca2d with SMTP id d9443c01a7336-22428bd5819mr284477315ad.35.1741706504925; Tue, 11 Mar 2025 08:21:44 -0700 (PDT) Received: from ?IPv6:2601:642:4c01:1a64:6cd0:e29:ca19:7a0d? ([2601:642:4c01:1a64:6cd0:e29:ca19:7a0d]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22410aa448dsm99494025ad.210.2025.03.11.08.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Mar 2025 08:21:44 -0700 (PDT) Message-ID: Subject: Re: Statistics import and export: difference in statistics of materialized view dumped From: Jeff Davis To: Tom Lane , Ashutosh Bapat Cc: pgsql-hackers , Corey Huinker Date: Tue, 11 Mar 2025 08:21:43 -0700 In-Reply-To: <1427602.1741702648@sss.pgh.pa.us> References: <1427602.1741702648@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2025-03-11 at 10:17 -0400, Tom Lane wrote: > Ashutosh Bapat writes: > > After fixing the statistics difference in dumps of tables with > > indexes, I now see difference in statistics of materialized view > > dump > > in the test I am developing at [1] (see the latest patches there). >=20 > Are you doing the restore in parallel by any chance?=C2=A0 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. Regards, Jeff Davis