fix forcing online analyze in case of analyze command
authorTeodor Sigaev <teodor@sigaev.ru>
Fri, 15 Jun 2018 13:07:48 +0000 (16:07 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Fri, 15 Jun 2018 13:07:48 +0000 (16:07 +0300)
online_analyze.c

index 3fe4da5..4396550 100644 (file)
@@ -446,9 +446,10 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected)
                rstat->tableid = relOid;
                newTable = true;
        }
-       else if (operation == CK_VACUUM)
+
+       if (operation == CK_VACUUM)
        {
-               /* force reread becouse vacuum could change n_tuples */
+               /* force reread because vacuum could change n_tuples */
                rstat->rereadStat = true;
                return;
        }
@@ -457,6 +458,8 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected)
                /* only analyze */
                rstat->changes_since_analyze = 0;
                rstat->analyze_timestamp = now;
+               if (newTable)
+                       rstat->rereadStat = true;
                return;
        }