Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 indexes on views vs tables

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2011-04-11 : 18:10:19
Greetings

I have a design question for you folks. I am trying to figure out if it would be more advantageous to create schema bound views with indexes or create indexes on tables that have views? Is it all the same or is there an advantage with one over the other.

Thanks!

If you don't have the passion to help people, you have no passion

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-04-11 : 18:22:00
Schema bound views have so many rules and limitations. Rarely do you need to go that route. Typically you can get by with just the indexes on the base tables that are involved in the views.

But there are some very good uses for indexed views, have a look through google for some examples.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

denis_the_thief
Aged Yak Warrior

596 Posts

Posted - 2011-04-12 : 15:57:23
I've witnessed myself how Indexed views can be a huge performance boost. You could think of it as pre-joining.

However Indexed views take up more memory and slow down inserts and updates (though this slow-down may be negligable).
Go to Top of Page
   

- Advertisement -