I'm new to spring framework so the questions might come up as silly.

I have a database with almost 5000 entries in it. I need to create a GET request which takes 5 parameters to filter the data. Depending on what parameters are present, the request will filter the data. I was able to do it but I don't think I am doing it efficiently. So here are my questions:

* First, Which one is a better approach? Retrieving all data from database using repository.findAll() and then using stream + filter to filter out the data **OR** writing the query in JPA repository interface and then simply calling those methods? Which one would be more efficient?
* Second, What is the best way to retrieve a huge amount of data? Like in my case, there are 5000 entries. So how should I retrieve them? I've read something about Pageable but not 100% sure. Is that the way to go or is there any other better option?

Any help appreciated. Thanks :)