October 11, 2009 at 9:11 am
Sorry folks... I lost track of this one...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 12, 2009 at 4:42 am
Would replacing the UDF's with tables containing the necessary data improve performance? I am thinking of the UDF that returns a 1 if the transaction is a peak time transaction. It would be a lot easier to maintain the table than a UDF if the peak times change. I'm thinking a table with the country id and columns for start and end times for the peak period. That would allow for the IsPeak to be determined by a simple case statement.
October 12, 2009 at 5:02 am
Ross McMicken (10/12/2009)
Would replacing the UDF's with tables containing the necessary data improve performance? I am thinking of the UDF that returns a 1 if the transaction is a peak time transaction. It would be a lot easier to maintain the table than a UDF if the peak times change. I'm thinking a table with the country id and columns for start and end times for the peak period. That would allow for the IsPeak to be determined by a simple case statement.
Undoubtedly it would. This suggestion was made a while back, the OP has yet to respond specifically about that.
October 12, 2009 at 10:05 am
Certainly an option to consider - however prior to then am toying with the idea of stored the calcs as persisted in temp/permanent tables...indexed where possible.
problem I'm having is the greater than equal to etc...
October 12, 2009 at 10:19 am
The overhead of calling a function is quite large
http://www.sqlservercentral.com/Forums/Topic790541-145-2.aspx#bm790978
October 12, 2009 at 6:31 pm
newbie2009 (10/9/2009)
Jeff, thats exactly it however the execution plan pretty much the same in the dev environment and it runs in 50mins which has been difficult to explain to be honest...obviously I/O demands on live are extreme by conmparison, but by a factor of 4....?
Pls see row counts attached.
First, the 50 mins is a bit long... I'd expect a report like this to run in a lot less time.
The other thing is, you say the execution plans are identical and that may be... except for the row counts that show up on the arrows. Does the dev box have the same number of rows as the production box?
And, my apologies... had other fires with sticks in them and haven't been able to spend much time on this even after I found it again...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 13, 2009 at 7:04 am
Yes the row counts and execution plans are the same - dev is refreshed overnight, agreed on the report time - it has to get faster quickly.
Agree with most if not all above on query re-design, however am at odds to explain behaviour.
Viewing 7 posts - 16 through 21 (of 21 total)
You must be logged in to reply to this topic. Login to reply