Your organization is having more then 2 million records for a single object? and you are facing performance issue due to Large data Volumes. Use Skinny table if performance is not good enough even after using custom indexes.
A skinny table is a custom table in the Force.com platform that contains a subset of fields from a standard or custom base Salesforce object. Force.com can have multiple skinny tables if needed, and maintains them and keeps them completely transparent to you.
What is the Skinny table?
Salesforce can create skinny tables to contain frequently used fields and to avoid joins. This can improve the performance of certain read-only operations. Skinny tables are kept in sync with their source tables when the source tables are modified.
You need to contact Salesforce Customer Support for skinny table. You can’t create, access, or modify skinny tables yourself. This table shows an Account view, a corresponding database table, and a skinny table that would speed up Account queries.
HOW SKINNY TABLES CAN IMPROVE PERFORMANCE
What are skinny tables? What makes them fast? For each object table that’s visible to you, Salesforce maintains other, separate tables at the database level for standard and custom fields. This separation, which is invisible to customers, ordinarily requires a join when a query contains both kinds of fields. A skinny table contains both kinds of fields and also omits soft-deleted records
- They avoid resource intensive joins
- Their tables are kept in sync with their source tables when source tables are modified
- They do not include soft deleted records
- Skinny help improve report and query performance in following ways-:
- Skinny tables provide a view across multiple objects for easy access to combined data
- Skinny tables contain frequently used fields and thereby help avoiding joins
- Skinny tables are kept in sync with changes to data in source tables
- Skinny tables can contain the following types of fields :
- Date and time
- Picklist (multi-select)
- Text area
- Text area (long)
Using them in an inappropriate context can lead to performance degradation instead of improvement
When to Use?
Skinny tables are most useful with tables containing millions of records. They can be created on custom objects, and on Account, Contact, Opportunity, Lead, and Case objects. In addition, they can enhance performance for reports, list views, and SOQL. The skinny table allows you to reorganize selected columns and rows of data into a separate table
- Skinny tables can contain a maximum of 100 columns.
- Skinny tables can’t contain fields from other objects.
- Skinny tables are copied to your Full sandbox orgs.
- Skinny tables aren’t copied to your sandbox organizations. To have production skinny tables activated for sandbox types other than Full sandboxes, contact Salesforce Customer Support.
Amit Chaudhary is Salesforce Application & System Architect and working on Salesforce Platform since 2010. He is Salesforce MVP since 2017 and have 17 Salesforce Certificates.
He is a active blogger and founder of Apex Hours.