New guy to phalcon here, sorry I tried to RTFM https://docs.phalcon.io/en/latest/reference/pagination.html but nothing of help there nor on the forum
The way I get it, Phalcon retrieves all data first, then displays whatever result based on the cursor and other pagination settings. The thing is my data set is quite large and the query is taking forever. Think of any way to retrieve only what you want to display based on the settings?
I'm thinking of an optional "SELECT COUNT(*)..." query first to get the number of pages (optional because we are talking optimization here) and then "SELECT .... LIMIT x OFFSET y"...