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)
 Design Question - Stored Value vs View

Author  Topic 

boggyboy
Yak Posting Veteran

57 Posts

Posted - 2011-10-17 : 19:41:38
I have a Data warehouse that will have millions of rows. One of the fields is a running total of values

Name, Sales, CumulativeSales
Joe, 10, 10
Sally, 22, 32
Jim, 20, 62

Should the CumulativeSales field be a stored value in a table or a derived value in a view? My data is more complex than my simple example above. Performance is a very strong consideration.

Nick W Saban

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-10-17 : 20:08:48
I would recommend storing it if you are going to use it often. Have it calculated at the time you import/refresh your warehouse.

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -