Something just crossed my mind, if i have a result set that is around the 1k mark just when I grab from the database.
If I use Doctrine(v1.2)_Pager limited to 25 per page. Does it reduce the amount of data pulled from the database to a mere 25. Or is it still grabbing the entire set and then reducing it?
Implemented as such:
$perPage = 25;
$numPageLinks = 25;
$pager = new Doctrine_Pager($q, $input->page, $perPage);
$result = $pager->execute(array(), Doctrine::HYDRATE_ARRAY);
$pagerRange = new Doctrine_Pager_Range_Sliding(
array('chunk' => $numPageLinks), $pager
);
$pagerUrlBase = '...';
$pagerLayout = new Doctrine_Pager_Layout(
$pager, $pagerRange, $pagerUrlBase);
$pagerLayout->setTemplate('...');
$pagerLayout->setSelectedTemplate(
'...'
);
$pagerLayout->setSeparatorTemplate('...');
$this->view->records = $result;
Doctrine’s pager will only request 25 records.
You might be confusing it with something like
Zend_Paginator_Arraywhich takes a full array and trims it down depending on the configuration.