2014-02-07 17-02-43
Vasco Pessanha
Aggregates starting at index X (Aggregates Paging)
2649
Views
30
Comments
On our RadarOn our Radar
Aggregates & Queries

It would be great to have a Start Index property in Aggregates so that I can have pagination patterns even without UI. This way, I could state that I want 50 records starting from record 50 (e.g. to display them in the second page of a table).


In current situation, OutSystems Platform only allows limiting the max records which are obtained (LIMIT / TOP). It is not optimized to allow primitives such as OFFSET to be included.
For this reason, it require huge time to fetch data from database using Aggregate. If OFFSET inplemented. it allows to do more faster data processing can do through Aggregate.

Merged from 'Inplement OFFSET for Aggregate' (idea created on 2015-06-29 03:29:12 by Ayumi Fukushima), on 2017-01-18 14:50:04 by Goncalo Borrega
Add the ability for paging should be a core feature built into simple query widget (Instead of having to create an "Advance SQL Query" with paging like this - for every single get record list query!)

MySQL: 
SELECT * FROM {Country} ORDER BY {Country}.[Name] LIMIT 25 OFFSET 25 

ORACLE/SQL Server
SELECT * FROM  {Country} ORDER BY  {Country}.[Name] OFFSET 25 ROWS FETCH NEXT 25 ROWS ONLY;

Note: When you build a web service more than likely you would add a get record list web service, and these services would require
 paging (Limit, Offset), all popular web services contain paging from facebook, twitter, linkedin, google etc

Merged from '[Simple Query] Add the ability for paging,' (idea created on 2016-05-29 09:20:42 by Robert Chanphakeo), on 2017-01-18 14:50:51 by Goncalo Borrega
and DB2 for i  ;)

SQL Paging With Limit And Offset In DB2 For i

Merged from '[Simple Query] Add the ability for paging,' (idea created on 2016-05-29 09:20:42 by Robert Chanphakeo), on 2017-01-18 14:50:51 by Goncalo Borrega
You can set the Record Limit on the Query

Merged from '[Simple Query] Add the ability for paging,' (idea created on 2016-05-29 09:20:42 by Robert Chanphakeo), on 2017-01-18 14:50:51 by Goncalo Borrega

Rebecca, you can not do paging with record limit. The query needs to know where to start (offset) 



Merged from '[Simple Query] Add the ability for paging,' (idea created on 2016-05-29 09:20:42 by Robert Chanphakeo), on 2017-01-18 14:50:51 by Goncalo Borrega

I second this idea. We had to convert a lot of aggregates to Advanced Queries just to be able to page the results. It surprised me that this isn't possible with OutSystems

I voice my support for this as well. We had to switch to advanced queries to implement paging (using OFFSET and FETCH NEXT). The biggest downside to this is it appears that using these queries to page through results gives us extremely slow query times (probably because OS uses "sp_executesql" to run the query). Because of how slow the query runs it's not a very good solution at all. I would love to see something implemented by the OS team that is performant and easy to set up.

I support this idea, I want to avoid complex queries as much as possible. Especially when exposing data using webservices and or server actions.

Would be nice if there was an startIndex property on the query so you only need to set that one with the max records and it's done!

The offset for paging is sorely needed.

2016-11-21 23-23-05
Gonçalo Borrêga
Merged this idea with 'Inplement OFFSET for Aggregate' (created on 2015-06-29 03:29:12 by Ayumi Fukushima)

Still on the radar?

@Trevor Olsen, The SQL OFFSET/FETCH functions will rely very heavily on correct indexes as they need to internally build a list of all the records EACH TIME before it can work out which ones to skip. If you have performance issues check to ensure that all the fields from the order by and the where clause are all contained in a single index, that might improve your performance.

For example, if you want to use the same Aggregate that is paging on ReactWeb or Mobile as well as TraditionalWeb, consider using API.

In that case, it must be SQL.

This is very inefficient and can be a factor in hindering code reusability.

Hi Vasco,

We've recently introduced reactive web apps where you can indeed set the start index on screen aggregates. 


In any case we'll keep this idea on our radar so we can implement this in server aggregates also in the future.

Thanks,
Tiago Simões


Merged this idea with 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 13:55:59 by J.)
2016-04-21 20-09-55
J.
 
MVP

Only part has been solved for reactive and mobile apps:

https://www.outsystems.com/ideas/3621/offset-and-next-rows-part-of-an-aggregate


However, this is heavily needed for exposing webservices.

Currently we have to do paginating with advanced queries, other we get a heavy load on the server itself etc.


so please, add it as well to the traditional webapplications!




This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões

Hi J.,

Thanks for your idea. To be honest with you, we are planning on focusing our efforts on reactive and mobile web apps. We still support traditional web apps, and intend to continue doing it for a long time. We will continue delivering fixes to it. But as for new implementations, we will invest more on a web stack that is more modern.

This being said, your feedback regarding web services make a lot of sense in any stack, so we definitely should have this for server aggregates also (which would also apply to traditional web apps).

Cheers,
Tiago



This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões
Merged this idea with 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 21:32:39 by Nuno Guedes)

This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões

New reactive Web Apps have the ability to set start index on the scope screen aggregates to be able to make pagination (list navigation) instead of the table records like in traditional web.

This is fine but the problem is that, if the data come from a DataAction because someone needs to fetch the data from an advanced query or even from an aggregate inside that action, Is not possible to use the StartIndex local variable because in this case both nodes wont receive it, as the StartIndex property is not available on them.

I think this scenario will be a very common use case in a real world Reactive Web App implementation, thus it is important to control the StartIndex of queries not only in aggregates available exclusively on screen scope.



This comment was:
- originally posted on idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 by Nuno Guedes)
- merged to idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' on 10 Jan 2020 09:59:17 by Tiago Simões


This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões

Good!



This comment was:
- originally posted on idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 by Nuno Guedes)
- merged to idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' on 10 Jan 2020 09:59:17 by Tiago Simões


This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões
Changed the category to
Aggregates & Queries


This comment was:
- originally posted on idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 by Nuno Guedes)
- merged to idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' on 10 Jan 2020 09:59:17 by Tiago Simões


This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões
Merged this idea with 'Pagination with limited data fetch' (created on 18 Dec 2019 18:24:55 by Stepan Kakosyan)

This comment was:
- originally posted on idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 by Nuno Guedes)
- merged to idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' on 10 Jan 2020 09:59:17 by Tiago Simões


This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões

Be able to fetch limited data except fetching all data at once. 

Be able make pagination usig Data fetch except using agregate(In reactive web app).



This comment was:
- originally posted on idea 'Pagination with limited data fetch' (created on 18 Dec 2019 by Stepan Kakosyan)
- merged to idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' on 10 Jan 2020 09:57:40 by Tiago Simões


This comment was:
- originally posted on idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 by Nuno Guedes)
- merged to idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' on 10 Jan 2020 09:59:17 by Tiago Simões


This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões

Hi Stepan,

Can you explain a little bit more what you have in mind?

Thanks,

Tiago Simões



This comment was:
- originally posted on idea 'Pagination with limited data fetch' (created on 18 Dec 2019 by Stepan Kakosyan)
- merged to idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' on 10 Jan 2020 09:57:40 by Tiago Simões


This comment was:
- originally posted on idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 by Nuno Guedes)
- merged to idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' on 10 Jan 2020 09:59:17 by Tiago Simões


This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões

Hi! Sorry for answering so late.


So now if we want to use pagination and for it fetch limited data usin StartIndex and Limit, we shout use use aggregate inside the block or a screen. Many times we need same data with same limitation, but for it we should use Server or Service actions, but inside them we cannot use StartIndex and Limit properties. In big datas for me it is a problem to fetch all data at same time.



This comment was:
- originally posted on idea 'Pagination with limited data fetch' (created on 18 Dec 2019 by Stepan Kakosyan)
- merged to idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' on 10 Jan 2020 09:57:40 by Tiago Simões


This comment was:
- originally posted on idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 by Nuno Guedes)
- merged to idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' on 10 Jan 2020 09:59:17 by Tiago Simões


This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões

So the Start index property is missing inside Server and Service actions and its a huge problem



This comment was:
- originally posted on idea 'Pagination with limited data fetch' (created on 18 Dec 2019 by Stepan Kakosyan)
- merged to idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' on 10 Jan 2020 09:57:40 by Tiago Simões


This comment was:
- originally posted on idea 'Be able to set StartIndex in Aggregates or AdvancedQueries in Reactive Web Apps' (created on 29 Oct 2019 by Nuno Guedes)
- merged to idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' on 10 Jan 2020 09:59:17 by Tiago Simões


This comment was:
- originally posted on idea 'OFFSET and NEXT ROWS part of an Aggregate - traditional webapps' (created on 21 Oct 2019 by J.)
- merged to idea 'Aggregates starting at index X (Aggregates Paging)' on 10 Jan 2020 10:01:11 by Tiago Simões

This should be a "must have" in Outsystems. 


If, for example, do you want to encapsulate an aggregate, because sometimes is for a page with paggination, and others this aggregate is used to "export excel", you need use startindex property for page usage. If not, the only solution is to build an advance sql, loosing a lot time, and losing all the power of a lowcode tool.

I totally agree with Carlos Olías this should be standard in Outsystems...

What if you need to expose a REST API and need pagination?

You are forced to build an advanced SQL consuming a lot more time...


Hello everyone,

It would be very helpful. The example that Diogo gave is an excellent example of how the implementation of this idea would be very useful. 


Best regards,

Décio Miranda

Cmon OutSystems! Having this server side is a must. To allow standardization of queries across the factory without additional code or custom SQL.

That could be very useful!