Skinny tables are helpful when you have Large Data Volumes (more than millions of records in object). These tables improves the ready only operations like reports, SOQL query performances. Below are pointers which explain everything about Skinny Tables:
- Skinny tables are custom tables (read only) created by Salesforce if enabled by customer support. These tables contains important fields information instead of storing all fields information which is present in actual object.
- Skinny tables can be created for Account, Contact, Opportunity, Lead, Case, and custom objects.
- The Force.com platform automatically synchronizes the rows between skinny table and the base object,so the data is always kept current.
- Soft delete records ((i.e records in the Recycle Bin with isDeleted = true) are not present in Skinny tables which improves query output.
- Custom indexes are also copied if present in base table.
- Skinny tables support only few data types(Checkbox,Date,Date and time,Email,Number,Percent,Phone,Picklist (multi-select),Text,Text area,Text area (long),URL).
- The Force.com platform determines at query runtime when it would make sense to use skinny tables, so you don’t have to modify your reports or develop any Apex code or API calls
- You need to contact salesforce customer support in order to enable this.
Things which needs to be considered before implementing Skinny tables:
- Skinny tables can contain maximum of 100 fields. There are also limitation on data type as mentioned above.
- After creating Skinny table, if you decide to add one more field in Skinny table, then you have to contact customer support. They will delete existing skinny table and will recreate new one.
- If you change the data type of any field which is used in Skinny table, then Skinny table becomes invalid (unusable) and you need to contact customer support to again recreate it.
- Skinny tables can not refer fields from another object.
- Skinny tables get copied to full copy sandbox after refresh but not on other sandbox. in order copy it for other sandbox, contact customer support.