首页 > 解决方案 > 注意:下表中的一列或多列在 PostgreSQL 中没有统计错误

问题描述

我正在通过 shell 脚本运行 PostgreSQL 查询。

以下是脚本中使用的查询:

查询1:

select table_schema, table_name, column_name
from information_schema.columns
where data_type like '%timestamp%'
  and table_name not like '%_1_prt_%';

查询2:

select max(date_column)
from table_schema.table_name;

但是在运行脚本时出现此错误:

NOTICE:  One or more columns in the following table(s) do not have statistics: ops_support
HINT:  For non-partitioned tables, run analyze <table_name>(<column_list>). For partitioned tables, run analyze rootpartition <table_name>(<column_list>).
See log for columns missing statistics

您能否帮我解决错误或为什么我收到以下错误?

标签: postgresqlpgadmingreenplum

解决方案


为我固定:

ANALYZE table_schema.table_name;

推荐阅读