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

From Ashutosh Bapat
Subject Re: Statistics import and export: difference in statistics of materialized view dumped
Date
Msg-id CAExHW5tB7xw=_WazvwSZ2jffi6E4JoV_H36rXSjK+jrPNe-bEA@mail.gmail.com
Whole thread Raw
In response to Re: Statistics import and export: difference in statistics of materialized view dumped  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Statistics import and export: difference in statistics of materialized view dumped
List pgsql-hackers
On Fri, Mar 28, 2025 at 10:41 AM Jeff Davis <pgsql@j-davis.com> wrote:
>
> On Thu, 2025-03-27 at 17:07 +0530, Ashutosh Bapat wrote:
> > Pulled the latest sources but the test is still failing with the same
> > differences.
>
> The attached set of patches (your 0001 and 0002, combined with my patch
> v2j-0003) applied on master (058b5152f0) are passing the pg_upgrade
> test suite for me.
>
> Are you saying that the tests don't work for you even when v2j-0003 is
> applied? Or are you saying that your tests are failing on master, and
> that v2j-0002 should be committed?


When I applied v1 it didn't pass.

But applying v2j-0003, the test passes.

I don't think I understand the patch fully. But I have a comment.

+ * However, the section may be updated later for materialized views.
+ * Matview stats depend on the matview data, because REFRESH
+ * MATERIALIZED VIEW replaces the storage and resets the stats, and
+ * the matview data is in SECTION_POST_DATA. Also, the materialized
+ * SECTION_POST_DATA to resolve some kinds of dependency problems (see
+ * repairMatViewBoundaryMultiLoop()).
+ */

It feels like we can simplify this as: REFRESH MATERIALIZED VIEW
replaces storage and resets the stats hence the Matview stats should
be printed after printing REFRESH MATERIALIZED VIEW command in
SECTION_POST_DATA. Also the materialized view ... . Hence the section
may be updated later for materialized views.

--
Best Wishes,
Ashutosh Bapat



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.
Next
From: Ashutosh Bapat
Date:
Subject: Re: Test to dump and restore objects left behind by regression