过滤SQL Server视图以获得更好的性能

时间:2017-12-19 23:35:35

标签: sql-server sql-view sqlperformance sql-tuning

执行两个视图是否存在性能差异?如果审计包含数百万条记录,那么通过过滤视图内的数据或使用视图外的where语句可以获得性能提升吗?

select * from vwTestPerformance where AuditId = 5708701

select * from vwTestPerformanceFilteredInside
create view vwTestPerformance
as
select * from Audit
go
create view vwTestPerformanceFilteredInside
as
select * from Audit where AuditId = 5708701
go

0 个答案:

没有答案