Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SP takes longer than batch version
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01090888
Message ID:
01090951
Vues:
15
I already attempted the RECOMPILE option to no avail. (See Sergey's previous post).

I will post the batch version (the SP is virtually identical) shortly.

>Richard,
>
>Could you please try to hardcode the values in the WHERE or JOIN clause. (e.g. to use concrete values instead of @variables). If execution plan changes, that means that SP is confused with the way the variable values are assigned/handled and therefore does not know how to create proper execution plan. The workaround for this is usually WITH RECOMPILE clause, but it dooes not work every time.
>
>Worth a try
>
>Cheers,
>
>Zoran
>
>
>
>
>>The new info is from the SP...The batch uses a DIFFERENT plan. An index seek on the index I had set up.
>>
>>Identical params and tables. In fact, the SP is identical to the batch with the exception of the Declares for variables used as params. That's why this is weird.
>>
>>>>New info:
>>>>
>>>>According to the execution plan it is performing a clustered index scan on the DB tables and returns ALL of them. This is my bottleneck apparently. Should I use a join hint or some other mechanism?
>>>
>>>Are you running SP and batch against the same data?
State of Florida, DCF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform