Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > SQL Server 2005...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 10975 of 11262
Post > Topic >>

SQL Server 2005: functions become slow after a while

by =?ISO-8859-1?Q?Ren=E9?= <rene.ruppert@[EMAIL PROTECTED] > Apr 17, 2008 at 02:29 AM

Hi,

I'm having serious issues with our user defined functions. They get
very slow after a while. The functions I use have several IF-branches
which check input parameters. Always exactly one branch will be
executed.
Normally, the execution time of my functions is something like 300ms.
After a while though, it climbs up to 20 seconds (!!).
The interesting thing about it is now: if I just alter the function by
adding a blank somewhere it will be fast again. What the hell is going
on here?

To me it seems that 2005 is optimizing the function incorrectly. It is
executed on very different result sets (some are extremly small, some
are extensivly large). I can imagine that for one case hashed indexing
is better and for the other one nested loops. So maybe it sticks to
one ooptimization after a while? The problem is that I cannot really
prove it because I cannot force the behavior. It occurs suddenly it
won't go away until I perform the "add blank" action.

The server is a 8 processor DB cluster with 12GB of RAM, all SPs
installed (SP2 for 2005).

Any hints what to do?

Ren=E9
 




 6 Posts in Topic:
SQL Server 2005: functions become slow after a while
=?ISO-8859-1?Q?Ren=E9?= &  2008-04-17 02:29:07 
Re: SQL Server 2005: functions become slow after a while
Tom van Stiphout <no.s  2008-04-17 06:56:47 
Re: SQL Server 2005: functions become slow after a while
=?ISO-8859-1?Q?Ren=E9?= &  2008-04-17 07:38:16 
Re: SQL Server 2005: functions become slow after a while
Tom van Stiphout <no.s  2008-04-17 19:08:42 
Re: SQL Server 2005: functions become slow after a while
"Plamen Ratchev"  2008-04-17 10:52:36 
Re: SQL Server 2005: functions become slow after a while
--CELKO-- <jcelko212@[  2008-04-17 11:48:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 3:10:53 CDT 2008.