4

In attempting to determine the impact of using Text or LongTextArea types in an object, I was surprised by the values displayed in the Setup > Storage Usage page: the sizes for each object type were equal.

To test each type I created 3 Objects :

  1. ShortText : an object that contains a single custom field of type Text (255)
  2. LongTextAreaObject : an object that contains a single field of type LongTextArea(131072)
  3. LongTextAreaObjectEmpty : an object that is exactly the same as LongTextAreaObject that I am using as a control object where I will only populate the name and nothing else

Using DataLoader the following values were loaded (9999 records for each object type):

  1. ShortText had a Name field set to 'a' and the custom Text field set to a concatenated value of 255 'a' chars
  2. LongTextAreaObject had a Name field set to 'a' and the custom LongTextArea field set to a concatenated value of 65470 'a' chars
  3. LongTextAreaObjectEmpty had a Name field set to 'a' and no values in the custom LongTextArea field

For all 3 objects the Setup > Storage Usage page showed a figure of 19.5MB. enter image description here

I would have expected that the ShortText object containing the Text type field would have been smaller due to the amount of data being stored.

Is there an explanation of how the 19.5MB figure is reached? Are Text and LongTextArea some how stored in the same data type under the covers e.g. a CLOB (which would be an odd decision for a 255 length text field)?

2 Answers 2

5

Data Storage is not calculated by the number of fields or content in the fields. It calculated as a number of records. Custom Object take 2KB per record. Doesn't matter i if they have 1 field or 200 long text fields populated.

Salesforce uses a simplistic method for calculating storage usage. Most standard and Custom objects are 2KB but some special objects like PersonAccount take 4KB(as its an account and contact)

So in your case. 9999 records take

 (9999*2)/1024 = 19.52MB

SRC: https://help.salesforce.com/articleView?id=000193871&type=1

1
  • There are also a few that only take 1k - CampaignMember comes to mind - but since you have have a lot of those, that can be helpful if you can use them in place of more 'expensive' objects Commented May 4, 2019 at 18:44
4

What you are seeing in Data Storage is not based on the size of the field for respective object. The storage reflects the size of overall record that is stored in that object. Salesforce record size overview mentions that any record is roughly around 2KB in size (with some exceptions).

In your case the storage is approximately around 19.5MB based on 9999 records for each object.

You must log in to answer this question.

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