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 an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

QueryImplementedThingWithData service is executing pretty slow. Is there any other alternate

ddas
1-Visitor

QueryImplementedThingWithData service is executing pretty slow. Is there any other alternate

I have a Thing shape with around 20 Properties.

QueryImplementedthingsWithData service is working perfectly. but it's time consuming.

It's returning around 30 data in 36 seconds.

Is there any other alternate which can improve performance.

Regards,

Debdatta

3 REPLIES 3
wposner-2
14-Alexandrite
(To:ddas)

Yes.  This is actually documented elsewhere here in the community that this specific service call is slower.  The faster way is to just get the implementing things and then loop through them to get only the specific things and specific data that you actually need.

rnayak-2
12-Amethyst
(To:ddas)

Query Implementing things with Data fetches data for all the properties from the all thing instances. This would slow the performance if you have any image data. The best thing to do is get implementing things and then fetch only the properties that you need. Below is a simple example code that you can try.

The result set adds the Name and Desc columns to the end of result from prior query. You can simple extend this to include columns that you want from your template by modifying  types, columns and expression parameter withing if statement. I hope this helps !


var thingsList = ThingTemplates["GenericThing"].GetImplementingThings();

if (thingsList.rows.length > 0) {

    var params = {

       types: "STRING,STRING" /* STRING */,

        t: thingsList /* INFOTABLE */,

        columns: "Name,Desc" /* STRING */,

       expressions: "Things[name].name,Things[name].description" /* STRING */

    };

    var result = Resources["InfoTableFunctions"].DeriveFields(params);

}

ddas
1-Visitor
(To:rnayak-2)

Thank You Raghu.

I will try this out and will post the result.

Regards,

Debdatta

Announcements


Top Tags