Brettflan
Active member
For some reason even with all addons disabled, our staging forum is currently making around 346 queries on loading the forum index. This number of queries is basically the same either logged in on one browser as an admin and logged out in another browser. My test forum on a local VM with nearly the same setup only needs around 21 queries on the index page.
The vast majority of the queries are like those above, "SELECT cache_value FROM xf_permission_cache_content". Without addons in the picture, and with a nearly identical test forum setup needing a much more reasonable ~21 queries, I'm wondering why this one needs such a huge number of queries, apparently related to permissions, regardless of whether it's a guest or logged in admin user.
Any ideas why it's making so many permission queries?
- SELECT cache_value
FROM xf_permission_cache_content
WHERE permission_combination_id = ?
AND content_type = ?
AND content_id = ?
Params: 547, node, 295
Run Time: 0.000045
Select Type Table Type Possible Keys Key Key Len Ref Rows Extra SIMPLE Impossible WHERE noticed after reading const tables - XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
- XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 150
- XF\Db\AbstractAdapter->fetchOne() in src/XF/PermissionCache.php at line 73
- XF\PermissionCache->getContentPerms() in src/XF/PermissionSet.php at line 51
- XF\PermissionSet->hasContentPermission() in src/XF/Entity/User.php at line 936
- XF\Entity\User->hasNodePermission() in src/XF/Entity/AbstractNode.php at line 31
- XF\Entity\AbstractNode->canView() in src/XF/Entity/Node.php at line 52
- XF\Entity\Node->canView() in src/XF/Mvc/Entity/AbstractCollection.php at line 320
- XF\Mvc\Entity\AbstractCollection->XF\Mvc\Entity\{closure}()
- array_filter() in src/XF/Mvc/Entity/AbstractCollection.php at line 189
- XF\Mvc\Entity\AbstractCollection->filter() in src/XF/Mvc/Entity/AbstractCollection.php at line 321
- XF\Mvc\Entity\AbstractCollection->filterViewable() in src/XF/Repository/Node.php at line 144
- XF\Repository\Node->filterViewable() in src/XF/Repository/Node.php at line 20
- XF\Repository\Node->getNodeList() in src/XF/Pub/Controller/Forum.php at line 50
- XF\Pub\Controller\Forum->actionList() in src/XF/Mvc/Dispatcher.php at line 321
- XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
- XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
- XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
- XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
- XF\App->run() in src/XF.php at line 390
- XF::runApp() in index.php at line 20
- SELECT cache_value
FROM xf_permission_cache_content
WHERE permission_combination_id = ?
AND content_type = ?
AND content_id = ?
Run Time: 0.000042
- SELECT cache_value
FROM xf_permission_cache_content
WHERE permission_combination_id = ?
AND content_type = ?
AND content_id = ?
Run Time: 0.000041
- SELECT cache_value
FROM xf_permission_cache_content
WHERE permission_combination_id = ?
AND content_type = ?
AND content_id = ?
Run Time: 0.000041
- SELECT cache_value
FROM xf_permission_cache_content
WHERE permission_combination_id = ?
AND content_type = ?
AND content_id = ?
Run Time: 0.000042
- SELECT cache_value
FROM xf_permission_cache_content
WHERE permission_combination_id = ?
AND content_type = ?
AND content_id = ?
Run Time: 0.000041
Any ideas why it's making so many permission queries?