Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Bug in gemini_getworkload sproc? (Version 2.0.5)

web-app

I have noticed recently that the performance of the ProjectsWS.GetAllProjects web service seems to be degrading quite a bit in my Gemini Installation, so I did some research to find out why.  As I was researching this, I found that the webservice above was calling the geminigetworkload stored procedure.  I looked at the procedure, and found that the code of this procedure is listed below.  Specifically, in the second select statement, you are including the customfielddefs table in your from list, but not using any data from that table, and not actually joining that table to any other table in your query.  Therefore, the results of joining the customfielddata table and the issuesview are repeated once for every record in the cusomfielddefs table.  Since I had 611 customfielddefs in my database, this turned out to be quite a performance overhead.  When I commented out the highlighted code, it reduced the size of the recordset from 178,480 records (99.8% of them duplicates) down to 270 distinct records.  I thought you might like to know about this in case you are not already aware of it, so you can fix it in your next release.

create procedure geminigetworkload 
 @userid numeric(10,0) 
as 
begin 
 -- Send back the issues
 select a.projid,b.ProjName,a.issueid,a.issuekey,a.summary, 
  a.typedesc,a.statusdesc,a.resdesc,a.assigneddesc,a.prioritydesc, 
  a.isstype,a.issstatus,a.issresolution,a.isspriority,a.compname,
  a.startdate,a.duedate,estimatedays,estimatehours,estimateminutes,
  isnull(t.hourslogged,0) as hourslogged, isnull(t.minuteslogged,0) as minuteslogged
 from projects b,issuesview a
 left outer join
  (select issueid,sum(hours) as hourslogged, sum(minutes) as minuteslogged
  from timetracking
  group by issueid) t
  on a.issueid = t.issueid
 where a.assignedto=@userid
  and a.projid=b.projid
  and a.issstatus not in (select statusid from issuestatusfinal)
 order by a.projid asc,a.duedate

 -- Send back the custom fields for the issues
 select a.issueid, b.customfieldid, b.fielddata
 from customfielddata b,customfielddefs c, issuesview a
 where a.assignedto=@userid
  and a.projid=b.projid
  and a.issstatus not in (select statusid from issuestatusfinal)
  and b.issueid=a.issueid
 order by a.issueid
end

stevew
· 1
stevew
Replies (4)
helpful
0
not helpful

the highlighted color did not seem to come through in my previous post.  I changed this line:

 from customfielddata b,customfielddefs c, issuesview a
to this:

 from customfielddata b,/customfielddefs c,/ issuesview a


stevew
· 1
stevew
helpful
0
not helpful

Thanks for this. FYI - this is not called by the GetAllProjects web method.

We have made this stored procedure redundant in 2.1, which is due out soon.


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Thanks for the reply.  I noticed the bug because my webservice' call to GetAllProjects was timing out.  Now that I look at it closer, I have another custom web service that just calls the geminigetworkload procedure.  This web service was being called asynchronously shortly before the GetAllProjects Web service request begins.  So, the slowness in that procedure must have been interfering with the subsequent GetAllProjects webservice request.

Just for curiosity, will the geminigetworkload procedure be fixed in future versions of this application?  Or is it going away entirely?  If it is going away, is there an alternate web service or stored procedure I should call to get the list of issues assigned to a specific user, given their user id?  I'd prefer to use the standard web services exposed by Gemini where possible.


stevew
· 1
stevew
helpful
0
not helpful

The web method will stay the same, but the way the data is retrieved has changed.


Saar Cohen
· 5000
Saar Cohen