I was reading SFDC documentation and they state that using != or Contains will almost run the query in table scan.
With that said, we have 5 Million case records in production. When i check the query plan for below SOQL, it shows rows with table scan & index scan but as per the docs, the lowest cardinality cost is used for the query being executed. This means that the index scan was used.
Can someone confirm if the above is true ?. Please see the query plan result and the SOQL below :
Select RecordType.DeveloperName, CaseNumber, ContactId, RecordType.Name, Contact.Name, SystemModStamp from Case where AccountId ='XXXXXXXXXXXXX' and id != 'XXXXXXXXXXXXX' and (RecordType.DeveloperName = 'XXXXXX' OR RecordType.DeveloperName = 'XXXXXX') order by SystemModStamp Desc limit 5