What are Skinny Tables in Salesforce?
A skinny table is a custom table within the Force.com platform that contains a subset of fields from a standard or custom Salesforce object. Force.com has the ability to manage multiple skinny tables if needed and keep them completely transparent.
Salesforce uses skinny tables to contain frequently used fields and to prevent joins. The skinny tables are kept up to date when the source tables are changed. To enable Skinny tables, need to contact Salesforce customer support. When you enable Skinny tables, it automatically creates the tables and uses them. Skinny tables aren’t available for creation, access, or modification. You must contact Salesforce to update your skinny table definition if the report, list view, or query you’re optimizing changes – for example, to add new fields.
How Skinny Tables Can Improve Performance
Salesforce creates separate tables for standard fields and custom fields for each object table. The separation of these fields typically requires a join when a query contains both types of fields. A skinny table contains both kinds of fields but does not contain soft-deleted records.
In this table, there is a view of an Account, a database table corresponding to it, and a skinny table that speeds up Account queries.
The read-only operations that reference only fields in skinny tables don’t require an extra join, so they can be faster. Skinny tables are very effective when working with large tables containing millions of records because they speed up read-only operations, such as reports.
Skinny tables can be created on custom objects, and on Account, Contact, Opportunity, Lead, and Case objects. They can enhance performance for reports, list views, and SOQL.
Skinny tables can contain the following types of fields.
3. Date and time
7. Picklist (multi-select)
9. Text area
11. Text area (long)
Example for Skinny table
Instead of using a date range like 01/01/21 to 12/31/21—which entails an expensive, repeated computation to create an annual or year-to-date report—you can use a skinny table to include a Year field and to filter on Year = ‘2021’.
- A skinny table can contain a maximum of 100 columns.
- Skinny tables cannot have fields from other objects.
- Skinny tables are copied to Full sandbox orgs, but not to other sandboxes, so to activate that you must contact customer support.
Find the following blogs to know more about Salesforce.