function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SakthidasanSakthidasan 

why we use index

By default  primary keys, forgeign keys, custom fields marked as External Ids/Unique along with the system dates (like last modified) are indexed.but you we need index?it it useful for reterive large record,Please explain
Amit Chaudhary 8Amit Chaudhary 8
1) Working with Very Large SOQL Queries then indexing is required.
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL_VLSQ.htm

User-added image

2) Improve performance with Custom indexes using Selective SOQL Queries
https://help.salesforce.com/HTViewSolution?id=000006007&language=en_US

3) Know Thy Salesforce Field Indexes for Fast Reports, List Views, and SOQL
https://developer.salesforce.com/blogs/engineering/2015/06/know-thy-salesforce-field-indexes-fast-reports-list-views-soql.html

NOTE:- Indexes in a database are like the index in a book–they help you find what you are looking for fast. When you’re designing filters for a report, list view, or SOQL query, you can confirm that your filter condition fields have indexes by checking the field lists on an object’s detail page. Notice that the Indexed column clearly indicates whether a field has an index

Let us know if this will help you

Thanks
Amit Chaudhary