postgresql - 注意:下表中的一列或多列在 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
您能否帮我解决错误或为什么我收到以下错误?
解决方案
为我固定:
ANALYZE table_schema.table_name;
推荐阅读
- python - pandas.DataFrame 构造函数中不允许元组的元组
- c# - 如何使用 Mono Project 将 C/C++ 指针传递和保存到 C#,并将它们返回
- process - What is the difference between "time overrun" and "time limit exceeded"?
- python-3.x - 如何使用 sha256 散列变量
- node.js - 运行 docker push 到 ECR 时找不到 Docker 映像
- python-3.x - groupby 后无法将对象转换为日期
- angular - AngularFireAuth用电子邮件创建用户而不登录他
- python - 对 pandas 数据框的索引查找。为什么这么慢?如何加快速度?
- ios - 模态显示另一个 UIViewController 时不要关闭键盘
- pyspark - PySpark from_json 无名称 ArrayType 架构