To understand the query's that will get sent by the Mendix-server to the database, set the log level of ConnectionBus_Retrieve and you will see messages like this in your logs:
Likely you are also already seeing messages about retrieving more objects than "set as the max for retrieval". Check the client's state by, in the browser (except Firefox in parallel), press Ctrl-Alt-g and check the console/log:
Also: make sure you do not retrieve anything more than you need. Only the attributes that you show in the datagrid. Nothing more. And do retrieve this as one object per line, so no structure. This will make your retrieve, result in only one object per line instead of possibly several per line. Check your browser's log, in the inspectory (F12) see the console for these messages:
And check the state of your session. See if there are too many
If, after all that, your response are still not ok, consider OQL, like others said. Do so by adding a microflow as a datasource and have that flow call the OQL. This will likely increase your query dramatically.
Ankit,
If you are displaying 31,000 records in a browser, the lag you are seeing is likely due to the browser taking some time to render that numer of rows. You could test this by having the microflow return a smaller number of rows (say 100) and see if the lag is still there.
Is there a reason that many rows are needed at one time? You may want to revisit your user requirements and see if there is a way to return and/or display a smaller number of rows.
Hope that helps,
Mike
Hi Ankit,
Considering your scenario.
Try to replace your database retrieve with OQL , i believe it will reduce your time for sure.
Best Regards
Sharad