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.
Author |
Topic |
gaby_58
Starting Member
33 Posts |
Posted - 2013-07-29 : 11:07:15
|
Hi all, We have SQL Server 2008 and in that we have a database which has views created, these views are coming various tables and views totalling around 20(15 tables and 5 views). We had data from 2009 thru 2013. 2009 thru 2012 were accessed pretty fast from .Net application, but 2013 data is taking too long to load. So I crated table out of these views and now the data is coming faster. I am not sure this is the right approach. Is there any other way to make it faster? as it is not feasible to create tables out of all views, also memory issue in SQL Server itself. Please suugest what else can be implemented? I am not a DBA, I am a developer and maintaining this application.Thanks for any suggestion. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2013-07-29 : 12:16:25
|
You can also create the view as indexed view (or materialized view).Otherwise we will have to see the execution plans and/or the queries to see if there are improvements to make. Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
denis_the_thief
Aged Yak Warrior
596 Posts |
Posted - 2013-07-29 : 13:50:48
|
You may consider writing the query without the views and see if it is any faster. If your current query uses several views joined together, views of views or views containing unnessessary joins, a query without the views maybe faster. It all depends on whether SQL Server will choose a more efficient plan with your new query.And as always if you are missing any indexes (i.e. on joined columns), add indexes and see if that is faster.The indexed view is good to consider. They can be ripping fast but they do require extra memory (i.e. on disk) and will slow inserts and updates although perhaps insignificantly. Indexed views physically store data while regular views are just sql. |
|
|
kameswararao polireddy
Starting Member
19 Posts |
Posted - 2013-08-28 : 10:34:37
|
Hi,I think this may help youCreate a new table and dump all the data from the required views into that table.Then write a procedure which includes the result from the newly created table and call it in from your front end screen.Also create INDEX on the table to improve it's performance.P.Kameswara rao |
|
|
|
|
|
|
|