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 |
|
best_boy26
Starting Member
42 Posts |
Posted - 2011-03-19 : 10:00:09
|
| I have a SQL Table. And I have written againest of it lot of math Calculations and for each calculations I created views and finally I joined all these views as single view.When I run this final view which has internally about 10 views and taking lot of time and not getting output. I can see my CPU time is taking 100%.below are my quetions here!!!!!!!1) Now can anyone explain me the best way of getting the data without disturbing the database performance? 2) Looking for the SQL database performance on when we write the SQL queries.3) If I change these all quires to run from SQL Reporting services, then SQL query will run without any issues?4) Experts talks about indexing will indexing concept will do any favor for me since I have only one sql table?ThanksJJ |
|
|
SeanL
Starting Member
3 Posts |
Posted - 2011-03-22 : 09:09:58
|
| you have a few options here:1. Modify your views - create an indexed view. This should improve your performance. By default, a view is not indexed, so if it is relatively large, then the indexing will definately help. see: http://msdn.microsoft.com/en-us/library/aa933148(v=sql.80).aspx for more info.2. You could drop the views and use derived tables in your query. |
 |
|
|
Kinnerton
Starting Member
21 Posts |
Posted - 2011-03-22 : 10:46:16
|
| I'm with SeanL on this.Either flatten out your query into a single query and slap a covering index over it. Or break it up into temporary tables - which can make a complicated task significantly easier to manage. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
best_boy26
Starting Member
42 Posts |
Posted - 2011-03-22 : 17:05:28
|
| Thanks All.. on this support.. I am planing to test this by creating index, Yes the data i have about a million rows from one table |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
best_boy26
Starting Member
42 Posts |
Posted - 2011-03-23 : 00:39:20
|
| Around one million.. do you also suggest to use SQL Reporting services to get the data fast? |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|