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 |
KarthickRaju
Starting Member
2 Posts |
Posted - 2014-01-15 : 03:56:21
|
Hi All,I have one Select query in my project, which has 6 inner joins and three left joins. Taking two minutes to execute million records. All columns got properly indexed. I need all million records. Can't use Paging or something.I have checked the execution plan also. It's fine. May I know how to speed up the query execution? Our .Net code has the timeout property set to 30 seconds. I have to speed up the query to run within 30 seconds. Can anyone help me on this? Very urgent requirement. Thanks!Regards,Karthick Raju |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-01-15 : 05:04:01
|
first question is do you really need those many joins. but because we dont have any idea on how your query is and what you're trying to achieve out of it, we cant suggest anythingIf you can post some sample data from table and explain what you're trying to do using the query with expected output. we may be able to suggest a better alternative------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
KarthickRaju
Starting Member
2 Posts |
Posted - 2014-01-15 : 06:11:04
|
Thanks for your reply, Visakh!Yes, I do need all the columns. I am afraid I can't post any of the informations Is there any possibilites to parameter to View? I googled it. But, all said like it's not possible. Is it so? If not, Can you give me sample sql parameterized view? Thanks!quote: Originally posted by visakh16 first question is do you really need those many joins. but because we dont have any idea on how your query is and what you're trying to achieve out of it, we cant suggest anythingIf you can post some sample data from table and explain what you're trying to do using the query with expected output. we may be able to suggest a better alternative------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs
Regards,Karthick Raju |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-01-15 : 06:26:12
|
quote: Originally posted by KarthickRaju Thanks for your reply, Visakh!Yes, I do need all the columns. I am afraid I can't post any of the informations Is there any possibilites to parameter to View? I googled it. But, all said like it's not possible. Is it so? If not, Can you give me sample sql parameterized view? Thanks!quote: Originally posted by visakh16 first question is do you really need those many joins. but because we dont have any idea on how your query is and what you're trying to achieve out of it, we cant suggest anythingIf you can post some sample data from table and explain what you're trying to do using the query with expected output. we may be able to suggest a better alternative------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs
Regards,Karthick Raju
did you read my sugestion at all?I was asking on number of joins and not on number of columnsThere's nothing called parameterized view you need to write it as a procedure it you want to implement a parameterized logic.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
Kristen
Test
22859 Posts |
Posted - 2014-01-20 : 06:52:09
|
quote: Originally posted by KarthickRaju I am afraid I can't post any of the informations
You won't get much/any help then ... folk here won't spend their time guessing answers, because we all know from experience that that time is just wastedPost your query here, do a Global Find & Replace with Col1, Col2 and Table1, Table2 if your code is in some way private.Better still, copy the relevant tables to a temporary database, rename the columns (and your query) so you have a proper worked example, and then you can test any suggestions anyone makes (without having to work out what Col1 & Col2 actually related to in your original query! |
 |
|
|
|
|
|
|