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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

How to fetch 2000 rows of data from datatable in lesser time.

AP_10343008
13-Aquamarine

How to fetch 2000 rows of data from datatable in lesser time.

We are fetching almost 2k-3k rows data from datatable to populate in grid. It takes around 1 minute to populate data in tree grid. We also using data filter to filter data from datatable, it takes another 1 minute to filter data from datatable and to populate in grid. How to reduce the time when multiple users fetching data at same time in production environment.

8 REPLIES 8

Hi @AP_10343008  Create an index for each set of filter criteria commonly used under DataTable > Configuration > Index Settings

look at the below reference article.

https://www.ptc.com/en/support/article/CS363996?source=search

Rocko
17-Peridot
(To:AP_10343008)

Have you checked how that time is spent? Is it in execution of the service that gets the data, or in moving over the data to the client, or in the widget trying to render it?

AP_10343008
13-Aquamarine
(To:Rocko)

In Grid, All child rows taken from datatable. But Parent rows and its values will be calculated dynamically during execution. As childrows are 2500 in count in datatable, it might take lots of time to add parentrows for every 3 or 5 childrows.

Rocko
17-Peridot
(To:AP_10343008)

As Surya wrote, try to use indexing, but to be honest, that's a lot of items to show in a tree...

You could also share your code so readers could look into it.

AP_10343008
13-Aquamarine
(To:Rocko)

ok. Can we pull the data/ populate it in grid when user scrolling the grid ?

Rocko
17-Peridot
(To:AP_10343008)

I think you would need a collection for this. But even then, to be able to render a scroll bar, the system would have to know how many items there are. If indexing doesn’t solve the issue, maybe rethink the UX. How many of those 3k rows are actually needed by the user?

Compare with Google Search, they give you millions of results, yet they don’t show them to you, but just 10 at a time.

Hi @AP_10343008 ,

I observed the reply, but you still did not answer @Rocko's question, and we need to do that before providing an effective advice.

We need to know the following:

  1. How many seconds does the service takes in the back-end to execute
  2. How many seconds does the data output of that service takes to be sent to the browser
  3. How many seconds does the data, once received, takes to be rendered in the widget.

Items 1 and 2 you can take from Developer Tools/Network tab - let me know if you need more know how on how to do that. Item 3 you can manually time based on 1 and 2.

Only based on these items we should be able to provide an efficient answer.

 

1. 2.5k rows fetched from datatable in 12 secs. But it took one minute to add parent rows dynamically with its calculated value. Then output will be passed to the treegrid. It Renders quickly in 1 or 2 secs.
2. Customer wanted to see all the rows by changing the filters often in ptc filter widget.


Can we show treegrid format in pagination?

Do we have any event which gets triggered on scroll from treegrid?

 

 

Top Tags