61
Views
4
Comments
Aggregate max records 5000 only retrieves 1 record
Application Type
Reactive
Service Studio Version
11.54.29 (Build 62891)
Platform Version
11.18.1 (Build 37828)

Hi,

Today I faced some weird issue with one aggregate. 

I had 5000 in max records and using test values it retrieved me 7 records, wich is correct. But while debuggin and in runtime it only retrieve me 1 result from database.

I didn't understand why but as soon as I changed the max records to 100 it started working ok.

I've used 5000 records already in some projects and never faced an issue like this.

Any thoughts on this? 

Thank you.

2021-06-03 11-03-21
Anubhav Rai

Hi Paulo,
Which type of data do you have in this aggregate, are you storing any binary data? 

Regards,
Anubhav

2023-05-05 14-44-25
Paulo Jorge

Hi Anu,

It's plain simple data. Some fields with text, constraints, datetimes. Nothing unusual.

2021-03-18 21-03-15
Benjith Sam
 
MVP


Hi Paulo, 

I guess it might be because of platform optimization that only one record is displayed during the debugging session. This might be due to the aggregate result set not being utilized within that debug breakpoint scope, or perhaps the large max records value is a factor.

Try Debugging: For instance, What happens if you explicitly iterate the aggregate result set using ForEach in the same scope? - From what I've noticed, there are instances when it displays the entire aggregate result set, while other times it only shows a single record, which is the current one, and the number of iterations is more than one. 

I hope this helps you!


Kind regards,

Benjith Sam

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

Hi Paulo,

When fetching data from the database, then For Each-ing over the result, the Platform uses a database cursor to fetch each record, so only one record is available at a time. This is an optimalization that makes the program faster. If, for debugging purposes only, you want the content of the entire list, add a dummy ListDuplicate to your code (and don't forget to remove it after debugging!). You will now see the entire list in the debugger (or at least the first 150 records, I think that's the max the debugger will display).

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.