On Tue, 2025-03-11 at 10:17 -0400, Tom Lane wrote: > Ashutosh Bapat <ashutosh.bapat....@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