cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

GetImplementingThingsWithData() performance issue for Large data set

TanmeyTWX
17-Peridot

GetImplementingThingsWithData() performance issue for Large data set

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"
                      };

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3
mnarang
17-Peridot
(To:TanmeyTWX)

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

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

slangley
23-Emerald II
(To:TanmeyTWX)

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

Announcements


Top Tags