about Aggregate and SQL query

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.

Hi Biginner,


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


Cheers,

João

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

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.

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.

 

Hi,

Have a look on this links with example.


Vijay M-


Vijay Malviya wrote:

Hi,

Have a look on this links with example.


Vijay M-



Thank you for sharing the information.