It’s always hard to handle tables containing millions of records. You can create skinny tables to contain frequently used fields and to avoid joins, and it keeps the skinny tables in sync with their source tables when the source tables are modified.
Need to contact Salesforce Customer Support or your Account Manager to enable skinny tables.
It can be created on custom objects, and on Account, Contact, Opportunity, Lead, and Case objects.
Here is an example from Salesforce Documentation:
This table shows an Account view, a corresponding database table, and a skinny table that would speed up Account queries.
Skinny tables can contain the following types of fields.
- Checkbox
- Date
- Date and time
- Number
- Percent
- Phone picklist
- Picklist (multi-select)
- Text
- Text area
- Text area (long)
- URL
Skinny table can speed up queries. Instead of using a date range like 01/01/11 to 12/31/11—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 = ‘2011’.
Few points to remember:
- Can contain a maximum of 100 columns.
- Cannot contain fields from other objects.
- Data only copied to Full Sandboxes, but can be activated for other sandboxes on request.