Index: branches/RC/core/units/general/helpers/count_helper.php =================================================================== diff -u -N -r9002 -r10459 --- branches/RC/core/units/general/helpers/count_helper.php (.../count_helper.php) (revision 9002) +++ branches/RC/core/units/general/helpers/count_helper.php (.../count_helper.php) (revision 10459) @@ -223,11 +223,16 @@ */ function GetPermissionClause($prefix, $table_alias) { - $sql = 'SELECT PermissionConfigId - FROM '.TABLE_PREFIX.'PermissionConfig - WHERE PermissionName = "'.$this->Application->getUnitOption($prefix, 'PermItemPrefix').'.VIEW"'; - $view_perm = $this->Conn->GetOne($sql); + $view_perm = $this->Application->getCache(__CLASS__ . __FUNCTION__, $prefix); + if ($view_perm === false) { + $sql = 'SELECT PermissionConfigId + FROM '.TABLE_PREFIX.'PermissionConfig + WHERE PermissionName = "'.$this->Application->getUnitOption($prefix, 'PermItemPrefix').'.VIEW"'; + $view_perm = $this->Conn->GetOne($sql); + $this->Application->setCache(__CLASS__ . __FUNCTION__, $prefix, $view_perm); + } + $groups = explode(',', $this->Application->RecallVar('UserGroups')); foreach ($groups as $group) { $view_filters[] = 'FIND_IN_SET('.$group.', '.$table_alias.'.acl)';