Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexes in Functions
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01197412
Message ID:
01198101
Vues:
15
>>>In Sql Server 2000 user defined functions do not make use of Indexes. I have a procedure that calls a function to get a balance in Sql Server 2000. This procedure takes 9 seconds to run. If i take whats in the function and do it inline in the procedure it drops down to one second. We use the function because this routine is used in many procedures and therefore if we have to make a change to it we would like for it to be in one location. My question is, if we upgrade to Sql Server 2005 does it remedy this issue? If not, is there a way to make a function make use of Indexes?
>>
>>Incorrect. The queries in Sql Server 2000 user defined functions would use indexes the same way as anywhere else in T-SQL.
>
>
>When i use the function in my select statement it takes the procedure 9 seconds to run. If i copy the exact same code from the function and place it inline in the Select Statement it takes it 1 second. If it isnt due to indexes what would cause the speed difference?


Check the execution plan for both in the QA.

__Stephen
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform