I am using PDO against an Oracle server and pulling query results into a collection class that is iterable. I do this because many result sets are extremely large and would use too much memory if I just used fetchAll(). I’m now wanting to implement pagination, but I’m not sure how to do this without iterating the collection to the desired record and discarding everything before it. This seems very inefficient and an overall bad design. Is there any way to do what I want to do without wastefully retrieving and discarding unwanted records? Is limiting the query the only way?
I am using PDO against an Oracle server and pulling query results into a
Share
Yes, you should implement pagination before that, at the SQL query stage. Otherwise there’s nothing better than iterating and discarding (which is really horrible).