Skip to main content
17-Peridot
July 28, 2020
Solved

GetImplementingThingsWithData() performance issue for Large data set

  • July 28, 2020
  • 3 replies
  • 1855 views

Hi Folks,

@PaiChung @CarlesColl @Constantine 

I have 500 Things to fetch properties from.And I have already tried fetching the Things first and then query for required properties only. But it still takes lot of time to execute.

 

Is there any other way to fetch larger set of data from Things in a least possible time.

 

Note: Already tried below workaround but no luck.

         var ThingsList = ThingTemplates["Template"].GetImplementingThings();

 

              var params = {
                     types: "STRING" ,
                     t: thingsList ,
                     columns: "MachineNumber",
                     expressions: "Things[name].MachineNumber"
                      };

Best answer by Constantine

Hello @TanmeyTWX,

 

Since 8.4.x the state-of-the-art in fast querying is QueryImplementingThingsWithNamedData, which allows you to limit the number of returned and checked properties. Take a look at this post for a working example: https://community.ptc.com/t5/ThingWorx-Developers/How-to-use-QueryImplementingThingsWithNamedData/m-p/627679

 

As of today, this is the fastest out-of-the-box way I'm aware of to query things, unless you are prepared to implement some Java extensions, custom caches, etc.

 

Regards,
Constantine

3 replies

5-Regular Member
July 29, 2020

Did you test this as well ?

QueryImplementingThingsWithNamedData * service that returns only the requested properties of all the implementing Things. This service is similar to QueryImplementingThingsWithData, but takes two additional parameters:
  • basicPropertyNames: Basic property name are the generic fields for all properties: name, description, tags, isSystemObject, homeMashup, avatar, projectName
  • propertyNames: any custom properties
The returned JSON consists of the implementing Things with only the desired properties as opposed to all properties
 
Thanks,
Mukul Narang
18-Opal
July 29, 2020

Hello @TanmeyTWX,

 

Since 8.4.x the state-of-the-art in fast querying is QueryImplementingThingsWithNamedData, which allows you to limit the number of returned and checked properties. Take a look at this post for a working example: https://community.ptc.com/t5/ThingWorx-Developers/How-to-use-QueryImplementingThingsWithNamedData/m-p/627679

 

As of today, this is the fastest out-of-the-box way I'm aware of to query things, unless you are prepared to implement some Java extensions, custom caches, etc.

 

Regards,
Constantine

Community Manager
August 11, 2020

Hi @TanmeyTWX.

 

If one of the previous responses answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.

 

Thank you for your participation in our community!

 

Regards..

 

--Sharon