34
Views
6
Comments
Solved
Behavior of maxRecords in Aggregate
Application Type
Traditional Web, Reactive

When integrating an Aggregate with a table, you can limit the number of records using maxRecords. However, does the SQL executed on the server retrieve all records from the database and then return only up to maxRecords? Or does it fetch only the specified number of records (maxRecords) directly from the database?
SQL like:

Select Top(20) name, age from Employee 
Select Top(20) name, age from Employee Offset 40



2025-11-11 13-17-51
Rajan C
Solution

Hi, 

    Please check this post for detailed explanation

https://www.outsystems.com/forums/discussion/90927/keep-max-records-consistent-with-your-needs/

2023-11-22 10-51-50
Jozy Sohail

Hi Fly,

No, when you set the MaxRecords property in an Aggregate, the platform optimizes the SQL query executed on the server and it fetch only the specified number of records (maxRecords) directly from the database . It does not retrieve all records from the database and then filter them afterward. Instead, it applies the limit directly at the database query level.

hope it helps.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Jozy,

That is not true. Max. Records delimits the number of records that are transfered from the database to the server, but it does not limit the number of records fetched by the database.

2025-11-11 13-17-51
Rajan C
Solution

Hi, 

    Please check this post for detailed explanation

https://www.outsystems.com/forums/discussion/90927/keep-max-records-consistent-with-your-needs/

UserImage.jpg
fly away

Thanks, ありがとうございます。

2025-02-10 08-07-05
Sudha Narayanan
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.