We have an AppExchange listed package. This includes an object with a Datetime field that is really important in various queries. Several of our larger customers have had to have custom indexes added to this field in order to make the database queries the product does with this object scalable (i.e. to ensure the queries are selective enough).

We want to add a CustomIndex in the package for this and a few other fields since this is now possible and will avoid at least part of the additional efforts to support large customers going forward (sadly we will still need some skinny tables to be created by Support).

If we add the CustomIndex to the package, will this prevent package upgrades for those customers who have had this custom index added by support?

  • I don't think this is documented, but my hypotheses would be that, worst case scenario, they'd have to contact support to drop the custom index beforehand.
    – sfdcfox
    May 4, 2023 at 13:07
  • That's also my suspicion, but that could temporarily break the org since we would find queries failing due to lack of selectivity - the gap in time between the indexes being removed and the upgrade performed would need to be kept as close to zero as possible.
    – Phil W
    May 4, 2023 at 14:32

1 Answer 1


Having gone through a Support Case with Salesforce, I received the following answer:

Package upgrade will not update the existing custom indexes, that were created earlier by the support team. If any customer has custom indexes on specific fields created by the support and installs a package containing custom indexes on the same fields, the package installation will ignore the custom index which already exists.

I.e. we can safely package new custom indexes in the knowledge that this will not cause any issues if the org already has a custom index on the same field added by Salesforce Support.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .