update relpages and reltuples when vacuum full (#7040)
* Update relation's stats in pg_class during vacuum full. Hash index depends on estimation of numbers of tuples and pages of relations, incorrect value could be a reason of significantly growing of index. Vacuum full recreates heap and reindex all indexes before renewal stats. The patch fixes that, so indexes will see correct values. Backpatch to v10 only because earlier versions haven't usable hash index and growing of hash index is a single user-visible symptom. Author: Amit Kapila Reviewed-by: Ashutosh Sharma, me Discussion: https://www.postgresql.org/message-id/flat/20171115232922.5tomkxnw3iq6jsg7@inml.weebeastie.net * Collect QE's relpages and reltuples to QD And logic in swap_relation_files() to collect QE's relpages and reltuples to QD when doing vacuum full Co-authored-by: NJimmy Yih <jyih@pivotal.io> Co-authored-by: NAshwin Agrawal <aagrawal@pivotal.io> * Add test Add test to verify that relpages and reltuples has become proper numbers when vacuum full Co-authored-by: NTaylor Vesely <tvesely@pivotal.io> * Update PR pipeline failures Reviewed-by: NAdam Berlin <aberlin@pivotal.io> Reviewed-by: NAlexandra Wang <lewang@pivotal.io> Reviewed-by: NJimmy Yih <jyih@pivotal.io> Reviewed-by: NAshwin Agrawal <aagrawal@pivotal.io> Reviewed-by: NTaylor Vesely <tvesely@pivotal.io>
Showing
想要评论请 注册 或 登录