Click here to Skip to main content
15,894,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

I have a procedure to extract report ,i was used two scalar funs,and a table valued fun.

now as data increased too much the procedure too slow .

:(

how i can resolve this dangerous problem .

i did googling but i do not satisfy.

Pls suggest me

Shreeniwas
Posted
Updated 30-Aug-13 1:52am
v2
Comments
Aarti Meswania 30-Aug-13 9:12am    
are you using cross apply?

Since you did not provide DDL or DML for us to review and evaluate, here are a few general purpose ideas.

If there are JOINs, ensure that the columns used in the ON clause are indexed.

If a few non-Key columns are used in Where clauses, consider adding them to the index as an included column.

Use the SQLParameter Class to pass parameters to SQL statements not concatenated strings with embedded values.

Read Microsoft documentation on Improving SQL Server Performance[^]
 
Share this answer
 
v3
Comments
phil.o 30-Aug-13 8:37am    
5!
Mike Meinz has suggested you some tips.

you should also check this.

1.
in your sp check which function is taking highest time for execution.
Execution plan will tell you the cost of function.

2.
check execution plan, is it performing scan or seek for table column?
if a few no. of rows are fetched from table containing lots of rows, then apply index on particular column.

3.
if you have use cross apply with table function and it is retriving a lot data then you should create a view instead of function, because if for this scenerio you are using function then it will evalute function for many time depends on joining columns.

Hope it will help you to solve performance issue.
Happy Coding!
:)
 
Share this answer
 
Comments
jaideepsinh 11-Sep-13 3:21am    
5+ve!!
Aarti Meswania 11-Sep-13 4:43am    
Thank you! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900