Re: Statistics import and export: difference in statistics of materialized view dumped - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Statistics import and export: difference in statistics of materialized view dumped
Date
Msg-id a443f2322c61ab38d6b3ac3915fe0afaf0235b93.camel@j-davis.com
Whole thread Raw
In response to Re: Statistics import and export: difference in statistics of materialized view dumped  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Statistics import and export: difference in statistics of materialized view dumped
List pgsql-hackers
On Tue, 2025-03-11 at 10:17 -0400, Tom Lane wrote:
> Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> 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).
>
> 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.

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Printing window function OVER clauses in EXPLAIN
Next
From: Tom Lane
Date:
Subject: Re: Statistics import and export: difference in statistics of materialized view dumped