Dept of second thoughts: recursive case in ANALYZE shouldn't emit a
authorTom Lane <[email protected]>
Wed, 30 Dec 2009 21:21:33 +0000 (21:21 +0000)
committerTom Lane <[email protected]>
Wed, 30 Dec 2009 21:21:33 +0000 (21:21 +0000)
pgstats message.  This might need to be done differently later, but
with the current logic that's what should happen.

src/backend/commands/analyze.c

index ee2d4ee250c057e3d79fea2e300c3cd0b96ab107..3b23a7aa4f7f5ca7980d6edb068331c368a13619 100644 (file)
@@ -565,9 +565,12 @@ do_analyze_rel(Relation onerel, VacuumStmt *vacstmt,
    /*
     * Report ANALYZE to the stats collector, too; likewise, tell it to
     * adopt these numbers only if we're not inside a VACUUM that got a
-    * better number.
+    * better number.  However, a call with inh = true shouldn't reset
+    * the stats.
     */
-   pgstat_report_analyze(onerel, update_reltuples, totalrows, totaldeadrows);
+   if (!inh)
+       pgstat_report_analyze(onerel, update_reltuples,
+                             totalrows, totaldeadrows);
 
    /* We skip to here if there were no analyzable columns */
 cleanup: