Skip to main content
Mak One ha preguntado en #Customer Service
For a Master-Detail or Look Up relationship. First query simply matches ID (for lookup or master-detail field) whereas second one gets all records of detail from Master ID record. So, at last both will return same records. Only fetching them will be little different. So, which one should I use and which one will give better performance?

 

[select id, DetailObjField__c from DetailObj__c where Master__c=:MasterId]

 

OR

 

[select id,(select DetailObjField__c from DetailObj__r) from Master__c where Master__c.id=:MasterId]
4 respuestas
  1. 23 jun 2014, 11:46
    For a more in depth discussion and assistance with programming related questions, visit developerforce.com (https://developer.salesforce.com).

     

    This Answers Community is focused on configuration and design questions. Programmatic questions are best submitted to the developer forums at https://developer.salesforce.com where the forums and participants are geared toward programming troubleshooting and support.
0/9000