SystemModStamp and LastModifiedDate are system fields with similar behavior, but slightly different properties. To help your application scale and perform with large data volumes, it is important to understand the performance implications of choosing one field over the other when using them in SOQL filters.
What Is the Difference Between LastModifiedDate and SystemModStamp?
Both LastModifiedDate and SystemModStamp are system fields that store date and time values for each record.
LastModifiedDate is automatically updated whenever a user creates or updates a record. It can be set to a back-dated value to preserve original timestamps when migrating data into Salesforce.
SystemModStamp is strictly read-only. It is updated not only when a user updates the record, but also when automated system processes (such as triggers and workflow actions) update the record. As a result, it is always true that LastModifiedDate is less than or equal to SystemModStamp, but never greater.
How LastModifiedDate Filters Affect SOQL Performance
Under the hood, SystemModStamp is indexed, but LastModifiedDate is not. The Salesforce query optimizer will intelligently attempt to use the index on SystemModStamp even when a SOQL query filters on LastModifiedDate.
However, the query optimizer cannot use the index if the SOQL query uses LastModifiedDate to define the upper boundary of a date range. This is because SystemModStamp can be greater than LastModifiedDate, and using the index could cause records in that gap to be missed.
For example, the following query performs well because the optimizer can use the SystemModStamp index: SELECT Id, Name FROM Account WHERE LastModifiedDate > 2014-11-08T00:00:00Z
The following query cannot be optimized because it defines an upper boundary using LastModifiedDate: SELECT Id, Name FROM Account WHERE LastModifiedDate < CutoffDate__c
Options to Optimize Performance for LastModifiedDate
The simplest solution is to use SystemModStamp instead of LastModifiedDate in your SOQL filters. If your business requirements prevent this, consider these alternatives:
000386977

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.