500 Ошибка приложения

An exception has been thrown during the rendering of a template ("localhost:27017: too much data for sort() with no index. add an index or specify a smaller limit") in "/var/www/x1db-php/webapps/pskovedu/public/layouts/orgentry.twig" at line 21.

В файле: /usr/share/php/Twig/Template.php:146

Трассировка:

#0 /var/www/x1db-php/tmp/twig/c0/78/861c66c0469bb24e35375a24b961201e25e820342cdebbf43329bcdf6957.php(108): Twig_Template->displayBlock('content', Array, Array)
#1 /usr/share/php/Twig/Template.php(276): __TwigTemplate_c078861c66c0469bb24e35375a24b961201e25e820342cdebbf43329bcdf6957->doDisplay(Array, Array)
#2 /usr/share/php/Twig/Template.php(250): Twig_Template->displayWithErrorHandling(Array, Array)
#3 /var/www/x1db-php/tmp/twig/fe/f2/7ef735236f9abecd4a704b4a2a742a70a78f944f1189fbbe48fadf9fa635.php(24): Twig_Template->display(Array, Array)
#4 /usr/share/php/Twig/Template.php(276): __TwigTemplate_fef27ef735236f9abecd4a704b4a2a742a70a78f944f1189fbbe48fadf9fa635->doDisplay(Array, Array)
#5 /usr/share/php/Twig/Template.php(250): Twig_Template->displayWithErrorHandling(Array, Array)
#6 /usr/share/php/Twig/Template.php(261): Twig_Template->display(Array)
#7 /usr/share/php/Twig/Environment.php(292): Twig_Template->render(Array)
#8 /var/www/x1db-php/library/X1/View/Renderer/TwigRenderer.php(53): Twig_Environment->render('/var/www/x1db-p...', Array)
#9 /var/www/x1db-php/library/X1/View/View.php(200): X1\View\Renderer\TwigRenderer->render(Object(X1\View\View), Array, 'orgentry.twig', Array)
#10 /var/www/x1db-php/library/X1/MVC/Dispatcher.php(90): X1\View\View->render('orgentry.twig', Array, 'layout')
#11 /var/www/x1db-php/library/X1/App/FrontController.php(249): X1\MVC\Dispatcher->dispatch()
#12 /var/www/x1db-php/public/index.php(38): X1\App\FrontController->run()
#13 {main}

Последний sql запрос:

select "ROLE_ACL"."RESOURCEFK","RIGHTS"."ID" from "ROLE_ACL"
			inner join "RIGHTS" on ("ROLE_ACL"."RIGHTFK" = "RIGHTS"."SYS_GUID" and mod(coalesce("RIGHTS"."SYS_STATE",0),2)=0)
            where   "ROLE_ACL"."ALLOW" = 1 and mod(coalesce("ROLE_ACL"."SYS_STATE",0),2)=0
            and "ROLE_ACL"."RESOURCEFK" in ('pages') and "ROLE_ACL"."SYS_GUIDFK" in ('readonly')