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;
}
/* only analyze */
rstat->changes_since_analyze = 0;
rstat->analyze_timestamp = now;
+ if (newTable)
+ rstat->rereadStat = true;
return;
}
}
#endif
+
static void
relstatsInit(void)
{
else
{
Assert(relstats == NULL);
+
+#if PG_VERSION_NUM < 90600
onlineAnalyzeMemoryContext =
AllocSetContextCreate(CacheMemoryContext,
- "online_analyze storage context",
-#if PG_VERSION_NUM < 90600
- ALLOCSET_DEFAULT_MINSIZE,
- ALLOCSET_DEFAULT_INITSIZE,
- ALLOCSET_DEFAULT_MAXSIZE
+ "online_analyze storage context",
+ ALLOCSET_DEFAULT_MINSIZE,
+ ALLOCSET_DEFAULT_INITSIZE,
+ ALLOCSET_DEFAULT_MAXSIZE
+ );
#else
- ALLOCSET_DEFAULT_SIZES
+ onlineAnalyzeMemoryContext =
+ AllocSetContextCreate(CacheMemoryContext,
+ "online_analyze storage context", ALLOCSET_DEFAULT_SIZES);
#endif
- );
}
hash_ctl.hcxt = onlineAnalyzeMemoryContext;