Which is correct regarding SQL elements?
Application Type
Traditional Web

Hi Guys,

There is a question in Sample Exam Doc for Professional certification perhaps the answer given is different then what I read in OS best practice docs. Could anyone please suggest me which one is correct. The below first is from Sample Set :

3. Regarding SQL Elements, which of the following options is true?

A. The compiler optimizes the query, so only used attributes are retrieved.

B. The Max Records property limits the number of rows returned by the database engine.

C. Non-Select Queries do not require an output structure.

D. Query results can be cached for a configurable number of minutes.

Answer mentioned as D in Sample Set. Where as in Best practice docs URL https://success.outsystems.com/Documentation/Best_Practices/Performance_and_Monitoring/Performance_Best_Practices_-_Queries it suggest A as answer : 

Need your response asap!




Hi Sanjay,

I think the question refers to SQL elements and the documentation you shared is about aggregates.

By the way, options A, B and D are valid for aggregates, but only D is valid for the Advanced SQL elements.

Kind regards,


Thanks for the quick response João Marques !! I believe the documentation is for both and the screenshot posted describe for SQL queries only. So still I'm not confident. Also, Max record property plays role only on UI, lt limits the record in screen to display but DB engine fetch all the records from DB.

Hi Sanjay,

The documentation you included sure isn't clear about that. It is like @João Marques is saying. I think the documentation must be updated to use the word 'aggregates' instead of 'queries'.

Kind regards,


In my opinion,

A is correct for Aggregate but not for Advance Query. 

B is incorrect, it does not limit the results returned from database engine, database engine always return all results, but when we use this property, OS will return a copy with the limited number rows from the result. Please refer to this Control the number of records fetched from the DB

C is incorrect, both Aggregate and Advance Query all need a output structure

D is correct, results from both Aggregate and Advance Query can be cached.

Thanks for your interest Merliny. The link really provide good insights about Max Record property. But still I feel A is correct for query as it is clearly mentioned in documentation. I'm deep diving in these concepts and will post my findings asap.


I think B is also correct for Aggregates, but not for SQL queries.
When the Max. Records is set on an aggregate, OS adds TOP (x) to the query. When you use the Query.Count to get the total number of rows, it executes an additional query for that.



Hi Sanjay ,

I  totally agree with João Marques. Answer A and B only correct when it's Aggregate not SQL.

Please recheck the document you mentioned to make sure it's also apply to SQL.

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