Thinking about performance, what is the best way to page a large amount of data?
I'm currently using a
List<Produtos> , saving around 500 products in it, and using
subList(min,max) , returns what I need. However, I think this is not the best solution and I would like to know other alternatives to this problem.
The idea is to maximize performance between unnecessary queries in the database, because the maximum pool of the database is 4.