n_dead_tup vs n_tup_del in Postgres

huangapple go评论111阅读模式
英文:

n_dead_tup vs n_tup_del in Postgres

问题

n_dead_tup vs n_tup_delpg_stat_all_tables 中的区别是什么?

我理解的是 n_dead_tup 显示了被删除的元组数量,以及作为更新的一部分被删除的旧元组。

n_tup_deln_dead_tup 有什么不同?我能够在执行 VACUUM 后将 n_dead_tup 清零,但 n_tup_del 中仍然有一些计数。

英文:

What is the difference between n_dead_tup vs n_tup_del in pg_stat_all_tables?

What I understand is n_dead_tup shows the number of tuples that were deleted and the old tuples that were deleted as part of updates.

How does n_tup_del differ from n_dead_tup. I am able to clear the n_dead_tup to zero after doing vacuum and I have some count in n_tup_del

答案1

得分: 1

n_tup_del 是永久累积计数(直到重置或崩溃)。n_dead_tup 是一个当前计数器,会在清理操作时减少。它还会在更新操作以及中止的插入和更新操作中增加。

英文:

n_tup_del is permanent cumulative count (until reset, or a crash). n_dead_tup is a current counter which gets decremented by vacuum. It also gets incremented by updates, and by inserts and updates which abort.

huangapple
  • 本文由 发表于 2023年6月29日 23:23:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76582473.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定