Hi,

On Tue, 8 Apr 2025 12:14:08 +0000
"Ryohei Takahashi (Fujitsu)" <[email protected]> wrote:

> Thank you for your reply.
> I understand that the access plans are not guaranteed to be the same.
> 
> Can we add these notes to the pg_dump page in the PostgreSQL Documentation
> in order to prevent users from asking the same question?

I agree that it would be helpful to add this description, since the wording
“statistics manipulation functions” might give the impression that they can
influence generated plans.

I’ve attached a patch that adds a new paragraph to the warning section of the
documentation on statistics manipulation functions:

      Manually restored statistics do not guarantee that the same query plans
      will be generated as in the source environment, since factors such as
      relation sizes, index OIDs, and configuration parameters may affect
      planner behavior.

What do you think?

Regards,
Yugo Nagata

-- 
Yugo Nagata <[email protected]>
diff --git a/doc/src/sgml/func/func-admin.sgml b/doc/src/sgml/func/func-admin.sgml
index 1b465bc8ba7..bbdd20571d4 100644
--- a/doc/src/sgml/func/func-admin.sgml
+++ b/doc/src/sgml/func/func-admin.sgml
@@ -1959,6 +1959,12 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset
       <command>VACUUM</command> or <command>ANALYZE</command>) and should be
       considered temporary.
      </para>
+     <para>
+      Manually restored statistics do not guarantee that the same query plans
+      will be generated as in the source environment, since factors such as
+      relation sizes, index OIDs, and configuration parameters may affect
+      planner behavior.
+     </para>
     </warning>
    </para>
 

Reply via email to