Simple and short question, what is the cheapest way to query (plain SOQL) if an object has child records? I want to avoid running into limits even if there are parents with millions of child records.
You can use a
Left Inner Join to get the data you want with pure SOQL. For example:
SELECT Id FROM Parent__c WHERE Id IN (SELECT Parent__c FROM Child__c)
The joined rows do not count against your query row limit.