AnsweredAssumed Answered

getting AF Element categories performance problem

Question asked by Mladen on May 18, 2018
Latest reply on May 23, 2018 by David Hearn

Hi, I am getting the element categories (along with other information) for multiple elements, using the following code:


  if (element.Categories != null)
          result.Categories = element.Categories.Select(s => s.Name).ToList();



Each time this code is executed , a request to the SQL server is made by AFService:



declare @p14 datetime
set @p14='2018-05-18 08:31:27.290'
exec dbo.usp_GetObject @UserSID=0x01050000000000051500000076BDD562CA29F33EAF6D0A73F4010000,@objType=21,@ViewID='00000000-0000-0000-0000-000000000000',@UniqueID='74D5F5D8-2387-437C-BC70-A19876A72481',@rid=0,@qryDate='9999-12-31 23:59:58',@bCheckOut=0,@UserName=N'LAB64-CDL\Administrator',@MachineName=N'WS241',@depth=3,@bReturnNullVersion=0,@bReadPermOnly=0,@bReturnDeletedRows=0,@returnTime=@p14 output,@breturnallrefs=0
select @p14


This is a performance problem , especially if AF Server is running on a remote machine due to the network latency (due to call of AF Sdk do AF Service I guess).



Note, that before running the code above,





is called for all elements for which some information is requested. Also note, that I have double checked that getting the categories is causing the performance issue.


Can anyone please tell me whether something can be done to avoid this problem (and still get the element categories)?


Best Regards,