Follow-up from "Resolve "Improve performance of Search API (Advanced): users scope""
The following discussion from !33795 (merged) should be addressed:
-
@DylanGriffith started a discussion: (+1 comment) At this point in time we are loading everything from the DB, right? Wouldn't we prefer to keep these results and just return them rather than returning the
results_collection
which will result in another query?I may be missing something but it seems no matter what we do we're turning the results into an array here so it makes me think that we may as well no longer refer to the active record association again and just use the
permitted_results = results - redacted_results
and then alwaysKaminari.paginate_array
. Is that possible?