Serverside pagination to boost performance

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.

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.

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?

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

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.


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.

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.

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. 

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.

Harshavardan,

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

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.


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.

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?