97
Views
2
Comments
Solved
What does avoid indexes mean in best practice document?
Application Type
Traditional Web, Mobile, Reactive, Service

Hi i read this best practice, but i cannot understand what does it mean:

Can someone explain clearer with an example? 

regards and thanks

2021-06-21 12-37-59
Wei Zhu
Solution

You can access output aggregate with two ways
1. Current (Ex: search.List.Current)
   At this case, outsystems only need  keep current row in memory. 
2. Indexer(Ex: search.List[0])
  At this case, outsystems had to load all result to memory.

So you'd better avoid use indexer when iterating a query.

2023-11-07 18-53-22
José Rodrigues
Solution

Hi @ibox
A really good answer was given in this post already by Kilian: https://www.outsystems.com/forums/discussion/91712/best-practices-queries/
 
However an example can be the following:

I am iterating the output of the GetTickets aggregate in a ForEach cycle but inside I am them iterating the same list again in the ListFilter:

Another example could be if lets say in an assign inside the ForEach I would use an Index in the list that is already being iterated in the cycle like:


Hope this helps,
José Rodrigues

2021-06-21 12-37-59
Wei Zhu
Solution

You can access output aggregate with two ways
1. Current (Ex: search.List.Current)
   At this case, outsystems only need  keep current row in memory. 
2. Indexer(Ex: search.List[0])
  At this case, outsystems had to load all result to memory.

So you'd better avoid use indexer when iterating a query.

2023-11-07 18-53-22
José Rodrigues
Solution

Hi @ibox
A really good answer was given in this post already by Kilian: https://www.outsystems.com/forums/discussion/91712/best-practices-queries/
 
However an example can be the following:

I am iterating the output of the GetTickets aggregate in a ForEach cycle but inside I am them iterating the same list again in the ListFilter:

Another example could be if lets say in an assign inside the ForEach I would use an Index in the list that is already being iterated in the cycle like:


Hope this helps,
José Rodrigues

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