加入收藏 | 设为首页 | 会员中心 | 我要投稿 财气旺网 - 财气网 (https://www.caiqiwang.com/)- AI开发硬件、专属主机、建站、CDN、云容器引擎!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

视图与内联子查询 SQL Server 2005/2008

发布时间:2023-05-24 02:33:00 所属栏目:MsSql教程 来源:网络
导读: 本文介绍了视图与内联子查询 SQL Server 2005/2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序的某些区域中,我需要

本文介绍了视图与内联子查询 SQL Server 2005/2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序的某些区域中,我需要来自数据库中多个表的数据(我有一个应用程序,该应用程序有许多属性mssql 使用视图,每个属性都有多个定义,每个定义都有一个值).我需要应用程序的所有这些表中的数据.我应该使用视图(一个相当大的视图)还是子查询来选择记录?在子查询的情况下,优化器是否能够有效地工作?我也很感兴趣缓存是否适用于子查询.

In certain areas in my application I need data from several tables in the database (I have an application, the application has many attributes, each attribute has several definitions, and each definition has a value). I need the data from all these tables for an application. Should I use a view (one that would be rather large) or subqueries for selecting the records? In the case of subqueries is the optimizer able to work efficiently? I'm also interested if caching will work for subqueries.

推荐答案

视图通常就地扩展为子查询,除非您通过删除聚集索引来明确地将视图标记为持久化视图.

Views are typically expanded in place into subqueries, unless you explicitly mark the views as persisted by dropping a clustered index on them.

这篇关于视图与内联子查询 SQL Server 2005/2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

(编辑:财气旺网 - 财气网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章