5

Maybe very trivial question but I don't know the answer. When I create a new field , I always think why don't I give the max length for this field? How does 20 is different from giving 100 as length. Is there any performance difference in the database for this.

1 Answer 1

5

For normal objects, there's no difference in performance. For Custom Settings and Custom Metadata, allocating too much space will affect the number of settings/metadata records you can create, but otherwise don't affect performance. Note that Long Text Area (LTA) fields share a per-object character limit, too, so creating fields longer than necessary will limit how many LTA fields you can create.

2
  • I just made a couple of text fields significantly shorter. It concerned tens of thousands of records and the change was almost instantaneous. Either Salesforce has a superfast database underneath or such a change is merely administrative and has no consequences for created records. Commented Feb 20, 2023 at 11:11
  • 1
    @SanderdeJong Salesforce is heavily optimized to allow these kinds of changes to take a trivial amount of time even for millions of records. This includes changes like renaming picklist values, resizing fields, adjusting precision.
    – sfdcfox
    Commented Feb 20, 2023 at 15:05

You must log in to answer this question.

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