snowflake-cloud-data-platform - 从另一个视图创建视图是否有任何惩罚?
问题描述
我有历史化的表,然后从它们创建视图以仅保留最新和活动的数据。
我想制作将其中一些视图聚合在一起的视图,我将在其中将我的视图创建为SELECT * FROM {Other view(s)}。所以有点像这样:
表 -> 中间视图 -> 聚合视图
我只是想知道如果我的观点基于其他观点,我是否会遇到任何性能损失。我是否应该让我的聚合视图在代码方面更复杂,但直接基于基础表?
表 -> 聚合视图
还是根本没有区别?
非常感谢。
解决方案
From a performance viewpoint, it doesn't make any difference - unless you are making your view out of a single table, in which case you would be able to Materialize your view - in fact, one of the biggest limitations of Materialized Views is that the FROM has to refer to a single table.
From a software engineering viewpoint, I see many advantages like more reusable work and more flexible and, potentially, faster development (while developer-A works on View-A, developer-B works on View-B, and developer-C could even work on View-C to combine View-A and View-C).
The downside is the increase in complexity of the lineage of the views which might require a graphical representation in some cases where objects are too many.
推荐阅读
- angular - 当result为数组时合并两个api调用结果
- postgresql - pgAdmin 中锁定的几何列和查看器未正确显示
- emacs - 启动带有 nix 的 emacs 时出现 Fontconfig 错误
- c++ - Tbb 库:错误:编写自定义类函数而不是 lambda 表达式时调用函数不匹配
- php - Symfony 5,仅接受新角色的访问在控制器中不起作用
- python - cv2.imshow() 不更新
- python - 使用 BeautifulSoup 从网页下载链接
- html - 如何防止 display:flex 项目清除先前的浮动?
- java - 如何从条件语句中检索 EditText 值
- amazon-web-services - 如何转移合并两个 AWS 账户