@bezumkin I checked that and if you replace `$c->groupby('user');` with 
```php
$c->groupby($this->modx->getSelectColumns('modManagerLog','modManagerLog'));
$c->groupby($this->modx->getSelectColumns('modUser','User','',array('username')));
```

as you proposed above. It will generate **correct** SQL query.

So if you want, you can update the PR and I'll merge it. The speed improvement is really huge so it would be good to have it there!