Hi,
have been searching around on how phalcon handles large database and found below related info
https://forum.phalcon.io/discussion/7303/phalcon-with-large-database
I have tried the querybuilder for pagination and the page load quite some times (tested with 400k+ data - Mysql).
Sample controller as below. Is there any extra configuration need to be included? Is there any ways we can do this with partial page load instead whole page load?
Thanks guys
public function indexAction()
{
// Build query and Paginator
$builder = $this->modelsManager->createBuilder()
->
->from("UserPortal")
->orderBy('ID DESC');
$paginator = new \Phalcon\Paginator\Adapter\QueryBuilder(array(
"builder" => $builder,
"limit" => 20, // Or u can use some predefined value
"page" => $this->request->getQuery('page', 'int')
));
$this->view->page = $paginator->getPaginate();
//echo "<pre>";
echo json_encode($this->view->page->items->toArray());
//echo "</pre>";
}