sql server - index seek while calling the UDF itself, index scan while wrapping the UDF in sp -


i have udf of joins , when run it, read 100-150 pages (from sql profiler) if wrap udf in sp sp read 243287 pages.

furthermore, udf performs index seek sp performs index scan on 1 of searched columns.

can please advise?

based on comments (custid = @param1 or @param1 null) vs. (custid = @param1), think gail shaw's blog posting on catch-all queries provide insight you're seeing here. basically, think you're getting execution plan cached @param1 null case performs poorly when pass in real @param1.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -