No need to sort by active if you are selecting by ID. Additionally, $core->server and $core->user have this information already stored, you do not need to make additional SQL calls for the information.

`core->server->getData('column_name')`