Best way to carry Paginadas queries

0

Dear good afternoon,

My question is: What is the best way to make or show paged records? I am not sure of how many records the databases like mysql or postgres return queries more slowly. So, what is better? Make a query that brings, for example, 100 records and then make the page keeping the records in session, or, make a query based on data for each page consulted?

    
asked by jrodriguez 11.12.2016 в 01:12
source

1 answer

1

The ideal is to make a query based on data for each page consulted showing all the data each time for a simple reason: Consult the information you require each time you require it .

The difference is in how to make inquiries. That is, decide between:

  • Reload the page each time a request is made to the server.
  • Load the data asynchronously.

Only show what is required is unimportant when you have a small amount of data, but when working with large volumes there are some problems to deal with, for example:

And on the database side, you always have the Limit and Offset instruction to solve it.

    
answered by 13.12.2016 в 20:44