SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to get data faster?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gaby_58
Starting Member

30 Posts

Posted - 07/29/2013 :  11:07:15  Show Profile  Reply with Quote
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

Sweden
29910 Posts

Posted - 07/29/2013 :  12:16:25  Show Profile  Visit SwePeso's Homepage  Reply with Quote
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
Go to Top of Page

denis_the_thief
Aged Yak Warrior

Canada
581 Posts

Posted - 07/29/2013 :  13:50:48  Show Profile  Reply with Quote
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.
Go to Top of Page

kameswararao polireddy
Starting Member

India
19 Posts

Posted - 08/28/2013 :  10:34:37  Show Profile  Reply with Quote
Hi,
I think this may help you

Create 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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000