I am writing backend code in PHP where there are client requests and I have to show them a collection of users based on priority amongst many thousand users.
My Problem is this: since the queries are too heavy requiring a lot of inner joins and comparisons, that will make the code very slow and the response will consume a lot of time.
Can you suggest a method by which I can accumulate all the users, perform all queries and calculations without affecting the request and response times?