Entity Field Query - Most efficient way to get authors of nodes I have a content type which contains fields which I am filtering my results on. Of these results, I wish to get the email address of the user who authored the node.

Currently I am using an Entity Field Query to get the list of nids. There can be thousands of matching nodes.

To get the email addresses of the authors of the nodes I do a node_load_multiple with the nids of my EFQ, and then a user_load_multiple with the uids of those nodes.

Is there a way to cut out a few of those steps with EFQ? Or will performance not be as big of an issue as I think it is?

Here is a code example:

$query = new EntityFieldQuery();
  $query-&gt;entityCondition('entity_type', 'node')
        -&gt;entityCondition('bundle', 'application')
        -&gt;propertyCondition('status', 1)
        -&gt;fieldCondition('field_one', 'value', $value1)
        -&gt;fieldCondition('field_two', 'tid', $value2)
        -&gt;fieldCondition('field_three', 'tid', NULL, 'IS NOT NULL');
  $result = $query-&gt;execute();

  if (isset($result['node'])) {
    $nodes = node_load_multiple(array_keys($result['node']));
    $uids = array();
    foreach ($nodes as $node) {
      $uids[$node-&gt;uid] = $node-&gt;uid;
    }
    $users = user_load_multiple(array_keys($uids));
  }
You are doing a lot of potentially unnecessary loads. Unless you need those nodes at some point on the page request, you will be doing a lot of unnecessary database reads.

I would EFQ to get the node list, and then do another query to just get the $uids. This example will retrieve the node list you're looking for:

$efq = new EntityFieldQuery();
$efq-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', 'application')
  -&gt;propertyCondition('status', 1)
  -&gt;fieldCondition('field_one', 'value', $value1)
  -&gt;fieldCondition('field_two', 'tid', $value2)
  -&gt;fieldCondition('field_three', 'tid', NULL, 'IS NOT NULL');
$result = $efq-&gt;execute();

if (isset($result['node'])) {
  $query = db_query('SELECT DISTINCT uid FROM {node} WHERE nid IN :nids', 
    array(':nids', array_keys($result['node'])));

  $uids = $query-&gt;execute-&gt;fetchCol();
  $users = user_load_multiple($uids);
}