PostgreSQL自动清理表列的统计级别

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

PostgreSQL autovacuum Statistic Level For Table Column

问题

我们可以通过检查pg_class的reloptions列来列出表的自定义选项。例如; 类似这篇帖子。

select relname, reloptions
from pg_class
where relname = 'a_table';

然而,我在官方文档和互联网上找不到关于在修改列后列出自定义统计设置的任何信息,就像这样:

ALTER TABLE name ALTER [ COLUMN ] column_name SET STATISTICS integer;

我们如何列出这些设置呢?

英文:

We can list tables' s custom options why checking pg_class' s reloptions columns. For example; like this post.

select relname, reloptions
from pg_class
where relname = 'a_table';

Yet, I couldn' t find anything in official documents and on the internet to list custom statistic settings for columns after altering them like this:

ALTER TABLE name ALTER [ COLUMN ] column_name SET STATISTICS integer;

How can we list those settings?

答案1

得分: 0

统计目标不是表的属性,而是列的属性。因此,您将在列的元数据表pg_attribute中找到它。涉及的列是attstattarget。其他每列设置可以在attoptions中找到。

英文:

The statistics target is not a property of the table, but a property of the column. Therefore, you will find it in the metadata table of columns, which is pg_attribute. The column in question is attstattarget. Other per-column settings can be found in attoptions.

huangapple
  • 本文由 发表于 2023年7月6日 16:51:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76627089.html
匿名

发表评论

匿名网友

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

确定