Skip to main content
13-Aquamarine
June 18, 2020
Solved

Problems with Data Table and Collection

  • June 18, 2020
  • 1 reply
  • 6424 views

I have a data table with 17 fields and 296 records - figures 1 and 2. To show the records for this data table I have a mashup as shown in figure 3 containing a textbox, two buttonbars and a collection. The service that loads the collection is in figure 4. Basically what this service does is to filter and / or sort my data table.
My questions are:
# 1 - Since the data table has additional indexes in all fields where the collection can be filtered, why does the service take so long to load the collection when I don't use any filters?
# 2 - I can click on only one cell in the collection at a time. If after that I use any filter or change the sort option, how can I make the previously selected cell be selected again, since every time I filter or sort the data table, it redoes the collection?
My version of Thingworx is 8.5.6 and the database is postgresql.
Thanks in advance.

Best answer by Tudor

Thank you for the response, Marcus.  There are three things we can attempt to isolate the issue:

1. In the service code, add debug timing around the data table lookup such as:

var currentTime = new Date();
// Data Table Query code

var endTime = new Date();

var diff = (currentTime.getTime() - endTime.getTime()) / 1000 / 60;
logger.error("+++ delay: " + diff + " seconds ");

2. In the Mashup, load developer tools, go to the network tab, and capture a .har file per https://www.ptc.com/en/support/article/CS224691

 

3. In the Mashup, repeat the test above, but record the performance in the performance tab

 

This will help us determine if the delay is in fetching the data, processing the service, or rendering.

1 reply

Community Manager
June 18, 2020

Hi @marcusbarrozo.

 

Some questions:

 

  • How is the server configured?  Ram, CPU, etc.
  • Is it consistently slow?  Or was it only slow on the initial query run?Ra
  • When you say it takes "so long," how long is it actually taking?
  • When you run the service outside of the mashup, how long is it taking?

Regards.

 

--Sharon

13-Aquamarine
June 18, 2020

Your answers:

 

  • How is the server configured?  Ram, CPU, etc.
    • About this, what I know is it has 6 cores and 16 Gb of RAM, reaching 22 Gb. The performance in other mashups is quite satisfactory.
  • Is it consistently slow?  Or was it only slow on the initial query run?Ra
    • Especially in the first two queries. Then it stabilizes.
  • When you say it takes "so long," how long is it actually taking?
    • 10 to 12 seconds.
  • When you run the service outside of the mashup, how long is it taking?
    • The same time as above.

Regards.

 

Marcus