+ Start a Discussion
Chris760Chris760 

Salesforce Database Storage

Lets say you have an object in salesforce with 300 fields.  I then create two records, one where I only fill out 2 of the fields, and another record where I fill out all 100 of the fields.  My questions are: 1) Do both records take up the same amount of space in the database?  2) What determines the speed of a database on salesforce; the total size of how much space the database file takes up in MB?  Or is it based on the number of actual records (big or small) that are stored in the database file?

I have a salesforce org I'm working on with almost 300 fields and half a million records and it chugs like crazy (constantly times out when running queries and cant even open the tab view without timing out).  I think part of the problem is that the initial designer (a sales rep at the company) put every field he felt they could ever possibly need on the object (that only a couple records might ever use) instead of creating a seperate object to attach all these little bits and pieces of random information to.  As a result, there's always a ton of empty fields in the various records and I'm wondering if that might be a part of the problem.

Either way, any ideas or suggestions about working with objects containing millions of records would be hugely helpful.  We've already asked salesforce to add custom indexes to fields that get queried a lot, so I'm not sure what else can be done to speed things up.

Thanks.
Best Answer chosen by Chris760
bob_buzzardbob_buzzard
The majority of records in Salesforce take up 2kb of storage regardless of the number of fields or the size of those fields.  Full details are available at:

https://help.salesforce.com/apex/HTViewSolution?id=000193871&language=en_US

The speed of the database is determined by a number of factors, but 500k records isn't a particularly large data volume. If queries are timing out you should (a) check the queries to make sure they are only returning the fields that are needed, rather than everything on the record and (b) raise a case with support to see if there are additional custom indexes, or skinny tables that might help.

There's full information on techniques to deal with large data volumes at:

http://www.salesforce.com/docs/en/cce/ldv_deployments/salesforce_large_data_volumes_bp.pdf

All Answers

bob_buzzardbob_buzzard
The majority of records in Salesforce take up 2kb of storage regardless of the number of fields or the size of those fields.  Full details are available at:

https://help.salesforce.com/apex/HTViewSolution?id=000193871&language=en_US

The speed of the database is determined by a number of factors, but 500k records isn't a particularly large data volume. If queries are timing out you should (a) check the queries to make sure they are only returning the fields that are needed, rather than everything on the record and (b) raise a case with support to see if there are additional custom indexes, or skinny tables that might help.

There's full information on techniques to deal with large data volumes at:

http://www.salesforce.com/docs/en/cce/ldv_deployments/salesforce_large_data_volumes_bp.pdf
This was selected as the best answer
Chris760Chris760
Thanks for the good info Bob.  I'm currently entering Week 2 of Salesforce trying to troubleshoot what might be causing the problem.  The weird part to me is how the standard list view tab doesn't even want to open (like Recent Items and such).  It behaves as if it's waiting for every record in the object to be read before it renders the Recent Items default tab view, which doesn't make a lot of sense to me.  But support is looking into it.  Thanks for the response though!