Proper way to do entity query?
You are not doing the query quite right.  There are a few things you are missing.

You need to remember that fields can be on multiple entity types, and that entity IDs are not unique globally.  This needs to be part of the JOIN clause.

The other is that there is a deleted column, that represents whether the data item has been deleted or not.  This also needs to be part of the JOIN clause.

You also need to ensure node access rights are maintained for any query against the {node} table.

EntityFieldQuery will take care of all of this for you.  Otherwise, you should use db_select() to build the query, as you can -&gt;addTag('node_access') the query.

Something like this would be a start for node entities:

$query = db_select('node', 'n')
  -&gt;addTag('node_access');

$query-&gt;join('field_data_field_products f', 'f.entity_id = n.nid AND f.entity_type = :entity_type AND f.deleted = :deleted', array(
  ':entity_type' =&gt; 'node',
  ':deleted', 0,
));

$query-&gt;fields('n', array(...))
  -&gt;fields('f', array(...))


You would modify this to use different tables and types for different entities.  If you aren't querying against the {node} table, then you can skip the -&gt;addtag();

If you end up using EFQ, remember that it only returns the entity_ids, so you have to entity_load() the results (or use the entity specific version like node_load()).

Regarding the query, it is a good habit to put your base table first and then join the secondary tables.  This helps with readability.  You should also try to explicitly pick the fields you need and avoid * results.  There is no rule against this, it is just considered best practice by some.