doc, pg_upgrade: add vacuumdb w/ tips for generating quick stats
authorBruce Momjian <bruce@momjian.us>
Fri, 8 Dec 2023 01:06:23 +0000 (20:06 -0500)
committerBruce Momjian <bruce@momjian.us>
Fri, 8 Dec 2023 01:06:23 +0000 (20:06 -0500)
Reported-by: Magnus Hagander
Discussion: https://postgr.es/m/CABUevEwGBY-W7EkTbjMY1rC+mmRL3fMrnX6YaUkcr+7o9PSa3w@mail.gmail.com

Backpatch-through: master

doc/src/sgml/ref/pgupgrade.sgml

index 4f78e0e1c0bd8fdc3254dc1c223b4902cdcd1ad2..2520f6c50dd0fd71ab35a0ce3348f0067af535ba 100644 (file)
@@ -784,6 +784,17 @@ psql --username=postgres --file=script.sql postgres
      of the upgrade.  You might need to set connection parameters to
      match your new cluster.
     </para>
+
+    <para>
+     Using <command>vacuumdb --all --analyze-only</command> can efficiently
+     generate such statistics, and the use of <option>--jobs</option>
+     can speed it up.  Option <option>--analyze-in-stages</option>
+     can be used to generate minimal statistics quickly.
+     If <varname>vacuum_cost_delay</varname> is set to a non-zero
+     value, this can be overridden to speed up statistics generation
+     using <envar>PGOPTIONS</envar>, e.g., <literal>PGOPTIONS='-c
+     vacuum_cost_delay=0' vacuumdb ...</literal>.
+    </para>
    </step>
 
    <step>