Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fine tuning a SPROC
Message
From
21/06/2007 10:34:19
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
 
 
To
21/06/2007 10:18:54
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01234693
Message ID:
01234704
Views:
19
I set the indexes, but there was no performance gain. Does it take some time for the indexes to get created?

The performance hit is in the join. Is there anything useful I can provide for the execution plan?

>Do you have an index on Table1.EffectiveDate, Table2.StartDate and Table2.EndDate? Can you identify the performance hit in the execution plan?
>
>>I am trying to fine tune a SPROC that is taking about 25 seconds to run.
>>
>>I have one table with a record every day. I have a second table with a record for a time frame, and it has a StartDate and EndDate field.
>>
>>I want to link the tables together in one query. I have been doing something like this:
>>
>>
>>SELECT
>>     Table1.Table1ID
>>     , Table1.Field1
>>     , Table1.Field2
>>     , Table1.EffectiveDate
>>     , Table2.Table2ID
>>     , Table2.Field1
>>FROM
>>     Table1
>>          LEFT OUTER JOIN Table2 ON (Table1.EffectiveDate > Table2.StartDate AND Table1.EffectiveDate < Table2.EndDate)
>>
>>
>>This is getting me the results I want, but at a performance price. Is there a better way of doing this, like loading Table2 into a temp table before joining? Thanks!
Very fitting: http://xkcd.com/386/
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform