boucekv
boucekv

Reputation: 1230

Why executeQuery after refresh takes 100x more time?

I have a form with 4 datasources. It is in listpage style and have Datasource1 (big table with lots of relations, columns, and indexes) shown in grid. When I open this form it takes like 200ms to open it but when I refresh it it takes 13s to refresh.

I used the Code profiler tool and I find out that the time is consumed in Datasource1 in executeQuery() method by command super();

When the executeQuery() is called from form by

Datasource1_ds.executeQuery();

it takes 200ms to call it.

There is like 15 columns in grid on form and sorting by one takes a little less than 1s.

So my question is. What is called in super(); when the form is refreshed by task F5 and not called by openning form and calling Datasource1_ds.executeQuery();?

I try to use Code profiler with different setings and actions, debug the code in various action done, use Visual Studio Profiler, use Activity Monitor in Microsoft SQL server on Microsoft Dynamics AX database, changes the Datasource1 table, with no luck.

Everytime I end up on the super(); Only time when the refresh is fast is when I have filters on the grid and it shows less rows. (I try to use VisibleRows property on grid but it does not help.)

I am using Microsoft Dynamics AX 2012 R2

Upvotes: 0

Views: 1029

Answers (1)

kirv
kirv

Reputation: 36

I would suggest to capture with SQL Server Profiler queries that are executed (1) on initial executeQuery() when ListPage form is opened, then (2) on invocation of executeQuery() on form refresh.

Comparison of execution plans of these two queries must show the bottleneck. You may capture Showplan XML event.

Upvotes: 2

Related Questions