如何查找 postgresql 表中的观察数
我来自 DW/BI 背景,使用 SAS 多年,现在我的任务是找出 postgresql 表中表中存在的记录数量,
即在 SAS 中,我们有元表,其中包含有关表的详细信息、记录数量、列信息等在系统元表中以相同的方式postgresql中是否有可用的元表来动态观察?
我知道我们可以从表中选择 count(*) 但我不想这样做,我想知道 postgresql 中是否有内置元表来获取表中存在的记录?
非常感谢您的帮助。
I am from DW/BI background using SAS for many years now I have task to find out number of records present in tables on the fly for postgresql tables
i.e. In SAS we have meta tables which has details about tables and no of records, column info etc in system meta tables in a same manner is there any meta table available in postgresql to get no of observation on the fly?
I know we can do select count(*) from table but I don't want to do that, I want to know is there any built in meta tables in postgresql to get no of records present in table?
Highly appreciated your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
pg_class 系统目录包含有关每个关系(表、索引、视图、序列...)的信息。对于表,这包括表占用的元组(行)数量和磁盘页数的估计。例如:
请注意,reltuples 是“实数”类型,因此存储大约 6 个有效数字。
The
pg_class
system catalogue contains information about each relation (table, index, view, sequence...). For tables, this includes an estimate of the number of tuples (rows) and disk pages taken up by the table. e.g.:Note that reltuples is of "real" type and so stores about 6 significant figures.