视图和表在性能上的区别 [英] Difference Between Views and Tables in Performance

查看:64
本文介绍了视图和表在性能上的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么最适合包含大量数据的表?

What is best for tables with a lot of data?

我有一个基于某些过滤器创建报告的存储过程.在我的 SP 中,我阅读了表格并放置了所有内部连接和公式,然后在放置过滤器的 where 条件中.

I have a stored procedure that creates a report based on some filters. In my SP I read the table and put all the inner joins and formulas then in the where condition I put the filters.

谈论性能哪个更好?

创建一个包含所有连接的视图或读取表(就像我正在做的那样)?

Create a view with all the joins OR read the table (as I'm doing)?

推荐答案

与使用视图或直接表访问相比,性能更依赖于拥有适当的索引,后者(物化视图除外)的行为与同样的方式.

Performance is a lot more dependent on having the appropriate indexes than if you are using a view or direct table access, which (except for materialized views) behave exactly the same way.

这篇关于视图和表在性能上的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆