Closed tboro closed 7 years ago
When there is a lot of records in collection and we use default Vegas paginator and Data limiter on page >~450 we get error like this:
localhost:27017: Runner error: Overflow sort stage buffered data usage of 33557981 bytes exceeds internal limit of 33554432 bytes#0 /home/www/vegas/talentnetwork/vendor/vegas-cmf/core/src/Paginator/Adapter/Mongo.php(38): MongoCursor->rewind() #1 /home/www/vegas/talentnetwork/vendor/vegas-cmf/core/src/Paginator/Adapter/MongoAbstract.php(175): Vegas\Paginator\Adapter\Mongo->getResults() #2 /home/www/vegas/talentnetwork/vendor/vegas-cmf/data-limiter/src/DataLimiter/Paginator.php(146): Vegas\Paginator\Adapter\MongoAbstract->getPaginate() #3 /home/www/vegas/talentnetwork/app/modules/Vacancy/controllers/frontend/VacancyController.php(52): Vegas\DataLimiter\Paginator->getPaginate() #4 [internal function]: Vacancy\Controllers\Frontend\VacancyController->indexAction(false) #5 [internal function]: Phalcon\Dispatcher->dispatch() #6 /home/www/vegas/talentnetwork/vendor/vegas-cmf/core/src/Mvc/Bootstrap.php(162): Phalcon\Mvc\Application->handle(NULL) #7 /home/www/vegas/talentnetwork/public/index.php(15): Vegas\Mvc\Bootstrap->run() #8 {main}
The solution for it is setting index on 'created_at' in Mongo:
db.collection.createIndex({created_at: -1})
When there is a lot of records in collection and we use default Vegas paginator and Data limiter on page >~450 we get error like this:
The solution for it is setting index on 'created_at' in Mongo: