How to Set Aggrategate to use SQL Limit

Now I encounter a problem in the project development. Using Aggrategate, I find the retrieval speed is too slow, so I try to set max. Record, but I find that the SQL generated by Outsystems still retrieves all the data instead of set Limit.

Hi Reasol,

I just checked and it is working perfectly for me.

Below are my scenario:

I am having a entity "Employee" which is having 9 records in it.

Case 1: Max Records property not set then getting all records. See the below screenshot



Case 2: Max Records property set to 5 then only getting 5 records. See the below screenshot


Please debug your code and if still found issues then please share your snapshot of code or oml to check the issue.


Reagrds

-SK-

Shashikant Shukla wrote:

Hi Reasol,

I just checked and it is working perfectly for me.

Below are my scenario:

I am having a entity "Employee" which is having 9 records in it.

Case 1: Max Records property not set then getting all records. See the below screenshot



Case 2: Max Records property set to 5 then only getting 5 records. See the below screenshot


Please debug your code and if still found issues then please share your snapshot of code or oml to check the issue.


Reagrds

-SK-


if you want to set the max records then you have to follow the above process. If you want to set that In the Listing page the only 15 data will show at a time then you have to set the Line count in the Source Record list properties. I think it will help you to solve it,

Thank you,

Sudip

Please check the below attachment.

This is two options. I think it will help you.

Thank you,

Sudip

Shashikant Shukla wrote:

Hi Reasol,

I just checked and it is working perfectly for me.

Below are my scenario:

I am having a entity "Employee" which is having 9 records in it.

Case 1: Max Records property not set then getting all records. See the below screenshot



Case 2: Max Records property set to 5 then only getting 5 records. See the below screenshot


Please debug your code and if still found issues then please share your snapshot of code or oml to check the issue.


Reagrds

-SK-


Hi Shashikant,

I know your meanning,i do as this.However  I find the query is very slow.In fact, It still retrieves all the data when he retrieves.

As shown in the figure above, it actually retrieves all the data, only extracts some of the data, rather than retrieving only some of the data.


Thank you,

Reasol


reasol,

your query only retrieves 11 rows, see the Length attribute of the List in your output.  You can see those 11 rows right there in your debug, they are numbered [0] to [10].  What you are pointing to is the Count, this is the number of rows in your database that fit your query conditions.


This is basic OS stuff, I'd advice you to look at some of the free training material, This is a good beginners course, in there, this lesson covers the basics of aggregates, and this and this is more advanced stuff.


So you'll have to dig a bit deeper to understand why retrieval is slow, but it sure isn't because you bring back too many rows to the screen.


Dorine