检查物化视图是否被填充 [英] check if materialized view is populated
本文介绍了检查物化视图是否被填充的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 postgres 9.5.2(python 客户端)
Using postgres 9.5.2 (python client)
有什么方法可以检查是否使用查询填充了物化视图?一个不引发警告的视图未填充?
Is there any way to check if a materialized view is populated using a query? One that does not raise a warning the view is not populated?
推荐答案
快速回答:
SELECT relispopulated FROM pg_class WHERE relname = '<the table name>';
您可以找到有关 pg_class
表的更多详细信息 在文档中.据此,字段 relispopulated
应该适用于除某些物化视图之外的所有内容,我从该字段和字段名称推断,它将为您提供所需的内容.
You can find more details about the pg_class
table in the documentation. According to that, the field relispopulated
should be true for everything but some materialized views, and I infer from that and from the name of the field, that it will give you what you want.
这篇关于检查物化视图是否被填充的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文