AnsweredAssumed Answered

How to improve performance of element/attribute find?

Question asked by SvenBatalla on Sep 17, 2015
Latest reply on Sep 17, 2015 by SvenBatalla

I have 19,800 elements in my PIAF system.  On occasion I have need to collect them all.  Based on the example below, that should be pretty straight forward:

 

Loading Top Level Objects

 

Unfortunately, finding all the elements and then loading their attributes is extremely time-consuming.  Performing the simple find takes about 11-14 seconds.  That's not so great, but I could live with that if I had to.  The main problem is that I also need some of the attributes.  To achieve this, I can do the "LoadElements" call (as in the example above), or pick the specific attributes I want and use the "LoadAttributes" call like this:

 

AFElementTemplate baseTemplate = myDatabase.ElementTemplates["My Template Name"];
AFElement.LoadAttributes(
   myElementList,
   new AFNamedCollectionList<AFAttributeTemplate>
   {
      baseTemplate.AttributeTemplates["Attribute 1"],
      baseTemplate.AttributeTemplates["Attribute 2"],
      baseTemplate.AttributeTemplates["Attribute 3"]
});

 

Unfortunately, whether I use the "LoadElements" or "LoadAttributes", the performance of either call is about ~105s.  Add that to the 11-14 seconds, and my application is already 2 minutes behind the 8-ball before it is even included in the party.

 

So the question is:  is there an efficient way to retrieve all elements and (some) attributes from PIAF?

Outcomes