Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Sql Server Performance Issue

Author  Topic 

bhimrajg
Starting Member

5 Posts

Posted - 2008-12-31 : 08:06:50
Hello ,

we are facing some issues with performance with SQL server, we have more than 100000 sales deal records in one table and almost 2500 actual sales persons in another table.

We have created one Table valued UDF which takes three paramters and returns the sales deals information.

This udf returns approx. 89,000 rows for top level sales persons. But it takes almost 48-49 secs to return 89,000 rows with more than 20 columns for each row.

We believe that indexes are set properly. This was working much faster with less data. But with growing data, performance has degraded. Could you please help us to resolve this performance issue ?

Here is sample SP code :



SELECT
field1,
field2,
field3,
field4,
s.*,
field5,
field6,
field7,
field8,
field9,
field10,
field11,
field12,
field13,
field14,
field15,
field16,
field17,
field18,
field19,
field20,
field21,
field22,
FROM Level, fnGetWithMonthWINs(@loginid, @teamId,@IsNodeMultiteam) main
JOIN fnGetAlldataByProduct(@loginid,@teamId,@IsNodeMultiteam) S ON S.id = main.id
LEFT OUTER JOIN Locate ON s.LocationId=Locations.LocationId
WHERE Opps. Levelno = Level. Levelno AND Level.Letter <> 'L'
ORDER BY
field1,
field4,
field6,
field7,
field8,
field10,
field15,
field16,
field19

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-31 : 08:09:28
have you analysed the execution plan of query to see where bottlenecks are?
Go to Top of Page

bhimrajg
Starting Member

5 Posts

Posted - 2008-12-31 : 08:42:40
hello,

i have saved the execution plan but not able to attached here, do you want me to email you that execution plan?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-31 : 08:49:37
upload it in some shared server and post link
Go to Top of Page

bhimrajg
Starting Member

5 Posts

Posted - 2008-12-31 : 09:12:23
I have uploded the execution plan below

http://www.screencast.com/t/edsAREIt

click on "Download this media." and save the file as txt , the default type is xml,
pease change it to txt.
Go to Top of Page
   

- Advertisement -