Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
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
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.
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);
}
Thank You Raghu.
I will try this out and will post the result.
Regards,
Debdatta