Last Good Quote: Son's are the seasoning on our lives. - Someone on Facebook

Saturday, April 26

T-SQL - What performance benefits can views give me?

I won't cover it all, but read this and stop wondering:

http://stackoverflow.com/questions/439056/is-a-view-faster-than-a-simple-query

(Remember you gotta use them correctly, and just cause you got a hammer don't make all problems into nails)

Some highlights:

After a unique clustered index is created on the view, the view's result set is materialized immediately and persisted in physical storage in the database, saving the overhead of performing this costly operation at execution time.

these indexed views can work even when they are not directly referenced by another query as the optimizer will use them in place of a table reference when appropriate

View itself would provide us with a performance advantage (3x) over the simple use of the index alone
Using indexes to improve query performance is not a new concept; however, indexed views provide additional performance benefits that cannot be achieved using standard indexes.
This is true for MS Sql Server 2005 and beyond.

0 comments:

Post a Comment

Followers