Question: Can anyone help me understand which is more expensive in batch apex query locator, given an opportunity record has 100 million records.
I have custom date (custome_date__c) field in campaign object which can have null value. NOTE: Assume campaignId is set which is passed to the batch apex constructor and evaluated in query locator.
Option 1: SELECT campaign.Custome_Date__c, Id, Name from Opportunity where CampaignId = :campaignId
Option 2: SELECT campaign.Custome_Date__c, Id, Name from Opportunity where CampaignId = :campaignId AND campaign.Custom_Date__c = null
What I am not understanding from the documentation is that is the scan for date null limited to CampaignId in the where clause or regardless it will do a full table scan.