I have a function in which I query on Lead object and we have around 1 million leads. When we query on leads, we add a clause using a formula field in the query. for example,
[SELECT Id, Name, Status FROM Lead WHERE Standard_Phone__c='11234567890' LIMIT 1];
Standard_Phone__c is a complex formula field thus, it cannot be indexed in Salesforce.
Is there any solution I can use to optimize the query so that it should minimize the number of records being traversed?