Hi
Christoffer,
I went into the problem and it seems that there are two main issues.
The first one is that we get all items and iterate over them to get the relations. This one can be suppressed with a plain query to the items child table and getting just the relations between the items.
The second problem is in the displaying the results - for example: AuthItemTypeColumn::renderDataCellContent()
$am = Yii::app()->getAuthManager();
$labelType = $this->active || $am->hasParent($this->itemName, $data['name']) || $am->hasChild($this->itemName, $data['name']) ? 'info' : '';
Here we call hasParent() or hasChild() methods which trigger getItemPermissions() -> getAuthItem() method which queries the db 3 times for each column (AuthItemTypeColumn, AuthItemRemoveColumn, AuthItemDescriptionColumn).
If we cache the items and their relations when we get the descendants and ancestors this process gets very clean with limited number of queries.
I've made some implementation and I can send you a pull request in github to review it if you want ?
There is only one bit of a problem: If the methods hasParent and hasChild are triggered before the getAncestors and getDescendants methods will return false since the records are not cached yet. This can be solved with a single query to the db checking for the needed relation. I haven't implemented that since these two methods are used only in the view's table and the records are already available.
Br,
Ilko