462
Views
6
Comments
about Aggregate and SQL query
Question

I am using Aggregate to output the data, but since 10 tables are joined, the processing is slow and an ORA error occurs on the screen. So the error of changing this Aggregate to SQL query is canceled? Please tell me the advantages and disadvantages of Aggregate and SQL queries.

2018-10-29 08-31-03
João Marques
 
MVP

Hi Biginner,


You have this great article explaining the differences and when using each one of those.


Cheers,

João

2018-10-29 08-31-03
João Marques
 
MVP

Also to add, if you are using an aggregate which is feeding a table or a list, the platform optimizes the data it fetches from the database. In other words, in those situations, only the fields you are using will be fetched, regardless how many tables and columns you are joining.


Cheers,

João

2021-07-07 13-36-32
Hans Dollen

The advantage of Aggregates is that they are way more easily to maintain. So it has the preference above SQL queries. The advantage of SQL queries is that you can make advantage of complexer / more powerful statement which can be more efficient.


Joining 10 tables in an aggregate doesn't mean it will be slow, OutSystems just generates an SQL for your database, it doesn't contain any OutSystems specific code. 

Can you share your aggregate? perhaps you're missing some joins or some indexes on the entities.

UserImage.jpg
Biginner

Hans Dollen wrote:

The advantage of Aggregates is that they are way more easily to maintain. So it has the preference above SQL queries. The advantage of SQL queries is that you can make advantage of complexer / more powerful statement which can be more efficient.


Joining 10 tables in an aggregate doesn't mean it will be slow, OutSystems just generates an SQL for your database, it doesn't contain any OutSystems specific code. 

Can you share your aggregate? perhaps you're missing some joins or some indexes on the entities.

 I'm sorry, I can't share SQL information, but thanks for the hint. It is necessary to revise it because the SQL connection method may be wrong.

If you have any examples that would be helpful, we would appreciate it if you could show them. It is a process that joins several tables but is fast.

 

2026-01-15 03-18-59
Vijay Malviya

Hi,

Have a look on this links with example.


Vijay M-


UserImage.jpg
Biginner

Vijay Malviya wrote:

Hi,

Have a look on this links with example.


Vijay M-



Thank you for sharing the information.

 

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