Before we go into the definition of skinny table or how to create skinny table, we should understand the underlying concept and why it is required.
Salesforce has a multi-tenant architecture that means it provides a core set of services to all our customers in the multitenant cloud. No matter the size of business, you get access to the same computing power, data storage, and core features
Every logical database object that Force.com exposes is internally managed using metadata. Objects, fields, stored procedures, and database triggers are all abstract constructs that exist merely as metadata in Force.com’s Universal Data Dictionary (UDD). For example, when you define a new application object or write some procedural code, Force.com does not create an actual table in a database or compile any code. Instead, Force.com simply stores metadata that the system’s engine can use to generate the virtual application components at runtime.
Instead of attempting to manage a vast, ever-changing set of actual database, the platform storage model manages virtual database structures using a set of metadata, data, and pivot tables. Thus, if you apply traditional performance-tuning techniques based on the data and schema of your organization, you might not see the effect you expect on the actual, underlying data structures.
Skinny Table for performance improvement
Salesforce creates skinny tables to contain frequently used fields and to avoid joins. This can improve the performance of read-only operations. Skinny tables are kept in sync with their source tables when the source tables are modified.
You can’t create, access, or modify skinny tables yourself. If you want to use skinny tables, contact Salesforce Customer Support. you’ll need to contact Salesforce to update your skinny table definition.
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.
Skinny tables can contain the following types of fields.
- Date and time
- Picklist (multi-select)
- Text area
- Text area (long)
- 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. For other sandbox org - we have to contact salesforce support.