Need to understand List_Navigation(Paging) with aggregates

Need to understand List_Navigation(Paging) with aggregates

  

Hello everyone,

  • I am having a Table Records with List_Navigation for the paging purpose.
  • Table Records is associated with aggregate.
  • Line Count of Table Records is 10.

When Page loads Table record displays first 10 row of aggregate but I checked in prepration aggregate fetched 11 row from database id anyone having any idea why aggregate fetching 11 rows first time and when click on next page then it fetching 11+10= 21 rows, It means first time it is fetching Line Count of Table Records +1=11 row.

Can anyone explain why it is fetching Line Count of Table Records +1 rows for first page.

Hi Shashi, I'm not sure, but I think the extra record is just to know if there is still more pages, so the widget render the next correctly (but I may be wrong).

Regarding the second page, if the Line Count is 10, the aggregate will fetch only 11 records, not 21.

Cheers.

Hi Eduardo,

First of all thanks for your quick response.

I just checked if the Line Count is 10, then the aggregate will fetch only 11 records for first page and when click next button in paging then aggregate is fetching 11+10=21 records and if we click on 3rd page then fetch 11+10+10=31 records.

You can check using scaffolding of any entity and in refresh action where refreshing the aggregate.

Regards

-SK-

Shashi kant Shukla wrote:

Hi Eduardo,

First of all thanks for your quick response.

I just checked if the Line Count is 10, then the aggregate will fetch only 11 records for first page and when click next button in paging then aggregate is fetching 11+10=21 records and if we click on 3rd page then fetch 11+10+10=31 records.

You can check using scaffolding of any entity and in refresh action where refreshing the aggregate.

Regards

-SK-

Hello Shashi, 

You are right.
And the fact this is done this way is highly upsetting, as the biggest the number the records, the worst will be the performance on high number pages...

Cheers.

P.S. I've being discussing with a colleague and it seems that they do this because in SQL Server there is no easy way to fetch only a certain number of rows in the middle of a series (like it is possible in Oracle and MySQL, for example). 

Hello. 

My 5cts contributions.

Even is SQL Server you can limite the rows fetch using OFFSET and FETCH parameters.


https://www.essentialsql.com/using-offset-and-fetch-with-the-order-by-clause/

Regards

Yes I also discussed some DB experts they told me we can fetch certain number of rows in the middle of a series in SQL Server that`s why unable to understand why platform doing in this way,  there will be performance issue when high number of pages.


Regards

-SK-

Hi all,

I cannot be sure of the reasons why the platform behaves like that, but the relevant fact here is it does.

If you think that behaviour should change, I suggest you create an Idea, you are more likely to get the right people looking into it!

@Alberto that solution seems to work only when using ORDER BY?

Hi Jorge,

I just created a idea regarding the same.

https://www.outsystems.com/ideas/5913/table-records-with-list-navigation-performance-issues


Regards

-SK-

Yes @Jorge. You are right it must be used in a Order BY... afaik