Best practice deems that you should use
EntityFieldQuery (d7) for making queries that somehow involves fields on entites.
An example of such a query could look like this.
$query = new EntityFieldQuery(); $result = $query->entityCondition('entity_type', 'node') ->fieldCondition('field_foo', 'value', REQUEST_TIME, '>') ->execute();
In the above example, we are looking for nodes which has a timestamp value set in the future, it works just fine and all is good.
Is it possible using these APIs (which handles that fields potentially could be stored anywhere), and apply the condition on all revisions, instead of only the active revision?
When using SQL, you could make a custom query on the
field_revision_FIELDNAME table, but doing this would require you to make some database assumptions and break best practice.