未验证 提交 30bc2910 编写于 作者: S Shaoqi Bai 提交者: GitHub

Not modify reltuple and relpages in utility mode on QD (#6807)

上级 0b4be119
......@@ -1664,13 +1664,19 @@ vac_update_relstats(Relation relation,
/* Apply statistical updates, if any, to copied tuple */
/* GPDB-specific not allow change relpages and reltuples when vacuum in utility mode on QD
* Because there's a chance that we overwrite perfectly good stats with zeros
*/
bool ifUpdate = ! (IS_QUERY_DISPATCHER() && Gp_role == GP_ROLE_UTILITY);
dirty = false;
if (pgcform->relpages != (int32) num_pages)
if (pgcform->relpages != (int32) num_pages && ifUpdate)
{
pgcform->relpages = (int32) num_pages;
dirty = true;
}
if (pgcform->reltuples != (float4) num_tuples)
if (pgcform->reltuples != (float4) num_tuples && ifUpdate)
{
pgcform->reltuples = (float4) num_tuples;
dirty = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册