SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Training
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


FAQ Topics

All FAQ's
General DBA
General Developer
DBA Performance Tuning
Developer Performance Tuning
Clustering
Error Messages

USEFUL SITES :

ASP.NET Tutorials
Windows and SQL Azure Tutorials
Cloud Hosting Magazine
SharePoint Tutorials
Windows Server Help

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server

More     
 
Latest FAQ's

Add Node to A SQL Server failover Cluster failed with invalid ...
SQL Server Destination remote server error
Setting Up Data And Log Files For SQL Server
Will Check Constraints Improve Database Performance?

More     
   
Latest Software Reviews

dbForge Review
Spotlight on ApexSQL Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Data Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Doc 2008

More     

In my stored procedures I have the option of calling the same data from either a table or a view. For best performance, should I be calling a table or a view?



Anytime you call data from a view instead of a table, there is additional overhead, which can hurt performance. Because of this, optimum performance can be had by calling your data directly from a table, not a view.

If you don't use the stored procedure often, the performance difference will not be noticeable if you call a view instead of a table. But if you do call the stored procedure often, then you will indeed be able to see a difference.

Standard views (excluding indexed views in SQL Server 2000 and 2005) are best used as a way to ensure users are only able to see the data from a table that they are supposed to see. Views should be a part of your overall security strategy, and used only for this purpose.

 

Reader's Feedback 

I agree with this answer when you are designing a new database, but I have also found views very useful when modifying an old database. 

I ran into a situation where member data was being stored one way for an old system and another way for a new system.  Management wanted to stop making their users enter data twice, so they wanted the old system to start using the new tables.

One option would have been to rewrite all of the old VB code to make it use the new stored procedures that referenced the new tables.  Another option would have been to rewrite the old stored procedures to use the new tables. However, a simpler (and cheaper) option was to create views that generated resultsets that looked like the old tables, but used the data from the new tables. 

We dropped all of the old tables and gave the views the names of the old tables. By doing this, all of the old stored procedures automatically started using the new data and we did not have to rewrite any stored procedures or VBcode that retrieved member data. We only had to redo the stored procedures and VB code that inserted or updated data.

Paul Lach
Byrne Software Technologies, Inc.








C# Help and Tutorials | PHP MySQL Tutorial | Sharepoint Tutorial | Azure Tutorial | Cloud Hosting Magazine | ASP.NET Tutorials | Windows Server Help | Windows Phone Pro | Silverlight Ace | Visual Studio Tutorials | Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | SQL Server Training Videos | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 2010 Jude O'Kelly. All rights reserved