diff --git a/subuser.module b/subuser.module
index 342f96a..2d34ade 100644
--- a/subuser.module
+++ b/subuser.module
@@ -265,12 +265,22 @@ function subuser_user_register_form_submit($form, &$form_state) {
  *   An associative array of related accounts were key and value is user ID.
  */
 function subuser_load_all($account, $children = TRUE) {
-  $users = array();
-  foreach (relation_query('user', $account->uid, (int) $children)->execute() as $result) {
-    $relation = relation_load($result->rid, $result->vid);
-    $users[$uid = (int) $relation->endpoints[LANGUAGE_NONE][0]['entity_id']] = $uid;
+
+  $subusers = &drupal_static(__FUNCTION__);
+  // Our 'subuser' relation has the child entity at index 0, parent at 1.
+  $cp = empty($children) ? 1 : 0;
+  if (!isset($subusers[$account->uid][$cp])) {
+
+    $users = array();
+    foreach (relation_query('user', $account->uid, (int) $children)->execute() as $result) {
+      $relation = relation_load($result->rid, $result->vid);
+      if ($relation->relation_type == 'subuser') {
+        $users[$uid = (int) $relation->endpoints[LANGUAGE_NONE][$cp]['entity_id']] = $uid;
+      }
+    }
+    $subusers[$account->uid][$cp] = $users;
   }
-  return $users;
+  return $subusers[$account->uid][$cp];
 }
 
 /**
