692
Views
13
Comments
Serverside pagination to boost performance
Question

Hi Team,

In my application, I am displaying student records over 300000.

So the performance is very slow, How can I boost the performance of my application.

Can we do server-side pagination in outsystems which helps in performance?


Thanks in advance.

2017-12-13 08-27-28
Joey Moree

You could use a pagination widget and limit the results to 50 orso per page.

And add some filtering to allow records to easily be found.

Also make sure to use aggregates inside your preparation instead of calling them from a webservice, this allows the platform to optimize stuff on the page.

UserImage.jpg
Harshavardhan t

Hi Joey moree,

Thanks for your reply.

Right now I am using pagination, the problem is all 3,00,000 records are loading in client side at once.

So the performance is decreasing as the number of records is increasing in DB. So I need to perform server-side pagination which solves this problem. 

can you suggest the way we can implement server-side pagination?

2019-05-22 11-30-09
Marcelo Ferreira

Hi,

How are you getting those records from database? Because if you were using aggregates the pagination is done automatically by Outsystems. If you are using a rest or advance query to get the records you need to build the pagination by yourself.

Regards,

Marcelo

UserImage.jpg
Harshavardhan t

Marcelo Ferreira wrote:

Hi,

How are you getting those records from database? Because if you were using aggregates the pagination is done automatically by Outsystems. If you are using a rest or advance query to get the records you need to build the pagination by yourself.

Regards,

Marcelo

Hi Marcelo Ferreira,

I'm using Aggregate to fetch the records and pagination is working fine. But the problem i is loading all its records at one time so the performance is slow.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Harshavardhan,

If you use the output of a query as the Source of a Table Records or List Records, automatically OutSystems will limit the number of records fetched to the Line Count of the Table Records. So "server side pagination" is already in place. Of course, if you have followed the beginners course you will already know how to create pagination.

Most likely, your query is very slow, and it's not the number of records transfered between server and client that cause the slow-down. In that case you should optimize the query, and pagination is not the solution.

UserImage.jpg
Harshavardhan t

Hi Kilian Hekhuis,

Thanks for your reply, As you said server-side pagination is working by default in aggregate,

 but group by is not working like SQL  in outsystems, It is allowing me access attributes which are grouped by.

Other attributes are not accessible.

2020-02-28 09-46-54
Eduardo Jauch

Hi Harshavardan

On SQL is Not possible to show, in SELECT clause, any attribute other then those on the GROUP By clause, computed columns and aggregate functions (count, max, etc). 

This is an SQL characteristic, not an aggregate limitation. 

Cheers. 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

I'd say it's not only a characteristic, it's the very nature of a group by. A "group by" groups items that are equal into a big "bucket", and you can do things with the bucket like count the number of items in it, or sum the contents, or get the minimum or maximum value, but you can't get individual items out of the bucket.

2017-12-13 08-27-28
Joey Moree

Harshavardan,

Perhaps you can share what SQL you are trying to execute?

UserImage.jpg
Harshavardhan t

Joey Moree wrote:

Harshavardan,

Perhaps you can share what SQL you are trying to execute?

Hi Joey Moree,

Thanks for your reply,

My query looks like this

SELECT {TABLE1}.[ID],{TABLE1}.[COMPONENT],{TABLE1}.[TIME]

 FROM {TABLE1} LEFT OUTER JOIN {TABLE2} ON {TABLE1}.[ID] = {TABLE2}.[FK] 

WHERE ({TABLE1}.[COMPONENT]='interface1'
 group by {TABLE1}.[ID]


this query I need to achieve in Aggregate. Now I can access only table1.id value

But in sql, I can access id, component and time.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Harshavardhan,

Grouping by a table's Id is nonsense, as the Id is unique. Also, you cannot select columns that are not grouped by. Please, if you don't understand the basics of SQL, don't try to write SQL! Use Aggregates instead, they are far easier to master.

2019-06-15 21-39-22
Afonso Carvalho
 
MVP

Using a Group By over an Id means you'll still get every record since the Id is unique: this probably won't suit your purposes.

What are you trying to show on your screen, and why do you need a Group By?

UserImage.jpg
dlugolep

Hi, I have the same problem. 

Pagination on server site. I want to export it to an Excel file.

On the server side, aggregates have only "Max. Records" parameters. 

How to avoid errors like:

If I want to get them all?

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