|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, October 30, 2012 7:36 PM
Points: 148,
Visits: 69
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 9:52 AM
Points: 2,796,
Visits: 1,125
|
|
Thanks Mohit. This sure saved me some time!
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, February 06, 2008 9:10 PM
Points: 1,
Visits: 2
|
|
Hi, I am facing one performance issue.This is the scenario.
For eg., EmpId,EmpName,DeptId,DeptName,Sal are there.Except sal all the remaining columns values are same(I mean having same data).
Assume,here 4 rows are there in that table.
so I wrote a select query to get the data like 1,xx,1,yy,50,500,5000,1000
here 50,500,5000,1000... are the sal column values.
I wrote a function to get the sal values as comma separated ones if the remaining column values are same.But for Huge no' of records (assume for 25000 records), the performance is very bad.
So need a inbuilt query / any other solution for this problem.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, September 03, 2008 10:40 PM
Points: 286,
Visits: 8
|
|
For same purpose we can use cussor too. Can you specify which idea is better and why ? Cursor Or UDF.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 10:57 AM
Points: 323,
Visits: 1,195
|
|
Ran into the same issue here. This function causes my query to literally be 15 times slower. Going from under 1 second to over 15.
Haven't found a work around yet.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 10:57 AM
Points: 323,
Visits: 1,195
|
|
Actually I fixed this problem. I added an index on the table that I used in the function. This sped things right back up.
Have you tried adding some indexes?
|
|
|
|