Skip to content

[W-23938713] Use SystemModstamp instead of LastModifiedDate for delta sync in OOTB AFLS DB schemas - #47

Open
sf-vmunduru wants to merge 1 commit into
mainfrom
systemmodstamp-delta-field-w23938713
Open

[W-23938713] Use SystemModstamp instead of LastModifiedDate for delta sync in OOTB AFLS DB schemas#47
sf-vmunduru wants to merge 1 commit into
mainfrom
systemmodstamp-delta-field-w23938713

Conversation

@sf-vmunduru

Copy link
Copy Markdown
Collaborator

What & why

Swap the delta date field from LastModifiedDate to SystemModstamp in the OOTB AFLS DbSchema_* records, for every DATA-type schema whose object exposes a filterable SystemModstamp field.

Why: SystemModstamp is natively indexed on the core entity data table; LastModifiedDate is not. Delta sync filters on this field every cycle, so a non-indexed column drives full-scan queries that intermittently time out under load. This was the root cause surfaced in the Takeda sync-timeout investigation (W-23914702). Switching to the indexed SystemModstamp lets the delta query use the index and removes the scan. SystemModstamp also advances on every DB-level change (including cascade/system updates), so it is a superset-safe delta cursor relative to LastModifiedDate for offline sync.

Scope

  • Only LSConfig/lifeSciConfigRecord/lifeSciConfigRecords/ in this PR. Other folders are handled separately.
  • DATA-type schemas only. CONFIGURATION-type records are not delta-synced, so they were left unchanged even where DeltaDateField = LastModifiedDate.
  • Exactly one line changes per file: the <fieldValue> inside the DeltaDateField block. No whitespace, no other field, no unrelated record touched.

Per-entity verification method

Each candidate object was verified against a live LSC org (sdb619) via sf sobject describe. An entity qualified only if its describe returned a field named SystemModstamp with filterable: true. All 161 DATA candidates passed both checks.

Counts

Count
Total candidates (DeltaDateField = LastModifiedDate) 168
Changed (DATA + SystemModstamp filterable) 161
Skipped — CONFIGURATION type 7
Skipped — unsupported (field absent / not filterable) 0
Skipped — unknown (describe failed) 0

Skipped — CONFIGURATION type (left unchanged)

LifeSciDataChgDefRecType, LifeSciDataChgPersonaDef, ProviderActivityMeasureType, ProviderSampleLimitTemplate, PrvdClassificationLayout, PrvdClsfnAttrDefinition, PrvdClsfnLayoutAttribute

Entities changed (161)

All rows: old = LastModifiedDate, new = SystemModstamp, SystemModstamp present = yes, filterable = yes.

# Object API name
1 Account
2 AccountPlan
3 AccountPlanObjective
4 AccountPlanParticipant
5 AccountPlanProduct
6 AccountPlanRelaObjAnalysis
7 AccountPlanRelationship
8 AccountPlanStakeholder
9 AccountPlanStkhldrAction
10 AccountPlanStkhldrProduct
11 AcctPlanPtcpStakeholder
12 ActionPlan
13 ActionPlanItem
14 ActionPlanTemplate
15 ActionPlanTemplateAssignment
16 ActionPlanTemplateItem
17 ActivityPlan
18 ActivityPlanTerritory
19 Address
20 AppAlert
21 AppAlertTerritory
22 AppAlertUserResponse
23 BusinessLicense
24 BusinessLicenseProduct
25 CareSpecialty
26 Case
27 CodeSetBundle
28 CommSubConsentCmplSnpsht
29 CommSubscription
30 CommSubscriptionChannelType
31 CommSubscriptionConsent
32 ComplianceStatementDef
33 Contact
34 ContactPointAddress
35 ContactPointBestContactTime
36 ContactPointEmail
37 ContactPointPhone
38 ContactPointSocial
39 ContentDocument
40 ContentVersion
41 Dashboard
42 DataUsePurpose
43 DeviceSyncTransactionRecord
44 DigitalSignature
45 EngagementChannelType
46 Event
47 EventRelation
48 Expense
49 ExpenseParticipant
50 ExpenseType
51 Folder
52 GoalAssignment
53 GoalDefinition
54 GoalDefinitionProduct
55 Group
56 HealthcareFacility
57 HealthcareProvider
58 HealthcareProviderNpi
59 HealthcareProviderSpecialty
60 Holiday
61 Inquiry
62 InquiryQuestion
63 InquiryQuestionAnswer
64 LifeSciAccountListColumn
65 LifeSciAccountListMember
66 LifeSciAcctListFilterCrit
67 LifeSciDataChangeDef
68 LifeSciDataChangeRequest
69 LifeSciDataChgDefMngFld
70 LifeSciEmailTemplate
71 LifeSciEmailTmplFragment
72 LifeSciEmailTmplRelaFrgmt
73 LifeSciEmailTmplSnapshot
74 LifeSciMarketableProduct
75 LifeSciProductAcctRstrc
76 LifeSciStageAction
77 LifeSciStageObject
78 LifeSciStageOperation
79 LifeSciStageOperationAction
80 LifeSciStageOperationCondn
81 LifeSciStagePath
82 LifeSciStageValue
83 LifeScienceAccountList
84 LifeScienceAccountListObject
85 LifeScienceCustomScript
86 LifeScienceEmail
87 Location
88 MedicalInsight
89 MedicalInsightAccount
90 MedicalInsightProduct
91 ObjectTerritory2Association
92 Presentation
93 PresentationClickStrmEntry
94 PresentationForum
95 PresentationLinkedPage
96 PresentationPage
97 PresentationPageProduct
98 PresentationPartyAccess
99 Product2
100 ProductBatchItem
101 ProductDisbursement
102 ProductGuidance
103 ProductItem
104 ProductTerrDtlAvailability
105 ProductTerritoryAvailability
106 ProductionBatch
107 ProviderAcctProductInfo
108 ProviderAcctTerritoryInfo
109 ProviderActivityGoal
110 ProviderActivityGoalMeasure
111 ProviderActvtyPlanAdjusment
112 ProviderAffiliation
113 ProviderAffiliationProduct
114 ProviderSampleLimit
115 ProviderSmplLmtTmplAssignment
116 ProviderVisit
117 ProviderVisitDtlProductMsg
118 ProviderVisitMarketingItem
119 ProviderVisitProdDetailing
120 ProviderVisitProdDiscussion
121 ProviderVisitRqstSample
122 PrvdAccountTerritorySummary
123 PrvdAccountUserGroupInfo
124 PrvdActvtyGoalMeasureProdt
125 PrvdVstSmplLmtDiscrepancy
126 PrvdVstSmplLmtTransaction
127 RecordAlert
128 RecordType
129 Report
130 Sprint
131 Subject
132 SubjectAssignment
133 Survey
134 SurveyEngagementContext
135 SurveyInvitation
136 SurveyPage
137 SurveyQstnResponseOffline
138 SurveyQuestion
139 SurveyQuestionChoice
140 SurveyQuestionResponse
141 SurveyResponse
142 SurveyResponseOffline
143 SurveySubject
144 SurveyVersion
145 Territory2
146 TerritoryAccountScore
147 TerritoryAcctProdMsgScore
148 TerritoryAcctRcmdAction
149 TerritoryProdtQtyAllocation
150 TerritoryUserDowntime
151 TimePeriod
152 User
153 UserReaction
154 UserTerritory2Association
155 VideoCall
156 VideoCallParticipant
157 VideoCallPtcpRequest
158 VideoCallPtcpSession
159 VideoCallRecording
160 Visit
161 Visitor

Links

… sync in OOTB AFLS DB schemas

Swap DeltaDateField from LastModifiedDate to SystemModstamp for the 161
DATA-type OOTB AFLS DbSchema records whose object exposes a filterable
SystemModstamp field (verified via org describe on sdb619).

SystemModstamp is natively indexed on the core entity data table while
LastModifiedDate is not; this reduces scan-driven intermittent sync
timeouts (Takeda investigation W-23914702).

Scope: LSConfig/lifeSciConfigRecord/lifeSciConfigRecords only, DATA-type
schemas only. CONFIGURATION-type records left unchanged.
@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! It looks like @sf-vmunduru is an internal user so signing the CLA is not required. However, we need to confirm this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant