Hello,
I am constantly getting connection timeout for my application resulting in tables not loading etc. and I am wondering what could be the reason? Could it be because of the large amount of aggregates i am using?
Regarding aggregates, I have a few questions:
1) By default, all aggregates are fetch "At Start". Does this fetch all aggregates for my application or only those in that particular screen I am currently in?
2) What is the best practice for aggregates? Should I change those aggregates that I use for server/client action to be fetch "on demand" while those aggregates that i use to display as a table to be fetch "At Start"?
Thank you!
Optimize Aggregate
Review and optimize aggregates and queries to limit the data being fetched. Apply filters, limit data retrieval, and implement pagination to ensure that only the necessary data is being loaded at once.Add logging to critical sections of your application to capture execution times and any potential bottlenecks.
Please refer below link
https://www.outsystems.com/forums/discussion/87955/fetching-bulk-amount-of-data-from-aggregate/
Regards ,
Rajat
Hi @Low Nico
Yes, may be one of the reason is the connection timeout and tables not loading in OutSystems application could very well be caused by large aggregates or excessive data retrieval. Aggregates are essentially database queries, and if they involve large datasets or inefficient queries, it can lead to performance issues such as connection timeouts, especially if you are fetching a lot of data at once.
For point no 1 :- Only aggregates on the current screen are fetched, not all aggregates in the application.
For Point no 2 : - For best practices, use "At Start" for aggregates that are necessary for immediate display, and use "Fetch On Demand" for aggregates triggered by actions or events.
Thanks alot for your reply Rajat, very helpful! Any suggestions/alternatives on how to improve those large aggregates? I am afraid mine might be too large/excessive like you mentioned
Thank you so much again!
I find it strange that it always times out and nothing loads. At least some queries should be able to complete. Are you using all aggregates on screen or something is inside a data action?
Also, consider activating cache if the data is stable and some aggregates return the same information every time you call them.