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


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

Is it possible to edit question once posted?

Click the Edit link beside your question.

You asked the same questions in the Community forum as well. You see the price of denormalization - if you copy the same data to multiple places, you have to maintain them forever (such as updating the question, in this case). And if you didn’t update all places, you would introduce data inconsistency.