I know Data skew errors for Non-selective queries executed on custom field filters that are not marked as External throw this error, i.e. we cannot run SOQL on an object which has more than 100k records in it.
now, I know, it is kind of late for me to resolve :(, we already have packaged our field and now we need to turn on External ID field checkbox on it, but it is locked.
Please suggest what are my options here to make a fix on my app. I'm unable to execute SOQL on my object and that I cannot modify the SOQL to add more filters, it breaks the needed functionality logic, so I have to use that custom field.
Can't salesforce allow editing of the field packaged in our managed package? I tried contacting them but they blocked me saying that only certain attributes can be edited after packaging as explained in there Packaging Documentation.
Attribution to: VarunC
Possible Suggestion/Solution #1
Given that your package is already installed for customers, there is no option to roll back to beta, which can be requested of the ISV team.
Your only option might be to add a new External Id field, deprecate the old field, and create an install script to copy values from old to new field.
Attribution to: greenstork
Possible Suggestion/Solution #2
You can request custom indexing via partner support for customer(s) that hit this issue. They can create indexes in the specific customer org on most types of fields, as long as the index would help (they'll ask you to provide a sample query to check).
You can find most of the rules around indexed queries in a cheat sheet they've helpfully published to learn what questions to ask, and how to better optimize your data model.
Edit: I worked with John Tan of Salesforce's engineering team on writing up a blog post about some internals of the query optimizer, as well as a package that allows you to use a pilot REST API to check query selectivity.
Attribution to: ca_peterson
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/30369