Last post Mar 19, 2015 04:30 PM by jbassett
Mar 19, 2015 11:20 AM|jbassett|LINK
Can anyone tell me if there is a way to make a "View" that I pull from my asp.net code that is already "pre-calculated so I don't have to wait so long for it to return?"
Meaning, I have a big view with a rather big tsql statement but I don't want to have to have it re-calculate every time I pull it. Could you set the View to calculate itself like every 5 minutes or something so when I pulled it from asp.net I don't have
to wait for it to return?
Maybe this is how views work, but if anyone could shed some light on it I would appreciate. Thanks.
Mar 19, 2015 11:45 AM|PatriceSc|LINK
https://technet.microsoft.com/en-us/library/ms187864(v=sql.105).aspx ("indexed views") but note that this is a tradeoff (quicker to read but slowing down updates). You could also do this processing yourself by copying explictely the view data to a table.
If not already done, I would strongly suggest to first investigate why exactly the current view is slow (missing indexes ?). Sometimes this is not even a db problem (for example someone trying to render thousands of rows most of the time being taken in buidling/transmitting/rendering
a huge HTML page client side rather than really in reading data from the db).
Mar 19, 2015 04:30 PM|jbassett|LINK
Thanks. I'll take a look.