From 398e7102a28a446eb61cc998d334bb3ce6c96286 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Fri, 15 Jun 2018 16:07:48 +0300 Subject: [PATCH] fix forcing online analyze in case of analyze command --- online_analyze.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/online_analyze.c b/online_analyze.c index 3fe4da5..4396550 100644 --- a/online_analyze.c +++ b/online_analyze.c @@ -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; } -- 2.46.1