使用 UNIX SAS 查找 Netezza 表的大小
可以使用哪些语法/表来确定 Netezza 表的大小 (Gbs)?我通过 UNIX SAS(ODBC 或 libname 引擎)进行访问。我假设有一个视图可以提供此信息?
What syntax / tables can be used to determine the size (Gbs) of a Netezza table? I am accessing via UNIX SAS (either ODBC or libname engine). I assume there is a view which will give this info?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
因此,您对两个系统视图 _v_obj_relation_xdb 和 _v_sys_object_dslice_info 感兴趣。第一个 (_v_obj_relation_xdb) 包含表信息(名称、类型等),第二个 (_v_sys_object_dslice_info) 包含每个磁盘的大小信息。您可能想查看这两个表,以便更好地了解您真正想要的内容,但简单的查询是:
这将返回表的大小(以字节为单位),我将把转换保留为 GB作为读者的练习。还有一些其他有趣的字段,因此您可能想查看这些视图。
So you're interested in two system views _v_obj_relation_xdb and _v_sys_object_dslice_info. The first (_v_obj_relation_xdb) contains the table information (name, type, etc.) and the second (_v_sys_object_dslice_info) contains the size per disk information. You probably want to take a look at both of those tables to get a good idea of what you're really after, but the simple query would be:
This returns the size of the table in bytes and I'll leave the conversion to GB as an exercise to the reader. There are some other interesting fields there so you might want to check out those views.
您还可以使用 (_v_sys_object_storage_size )
You could also use (_v_sys_object_storage_size )
磁盘上的大小 (used_bytes) 表示压缩数据,并包括表中任何已删除行的存储空间。
表行计数统计(reltuples)通常非常准确,但它只是一个统计数据,并不能保证与“select count(*)”表行计数匹配。
您可以通过目录查询获取此信息
The size on disk (used_bytes) represents compressed data and includes storage for any deleted rows in the table.
The table rowcount statistic (reltuples) is generally very accurate, but it is just a statistic and not guaranteed to match the "select count(*)" table rowcount.
You can get this information via a catalog query