[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
Open
Conversation
… 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.
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Swap the delta date field from
LastModifiedDatetoSystemModstampin the OOTB AFLSDbSchema_*records, for every DATA-type schema whose object exposes a filterableSystemModstampfield.Why:
SystemModstampis natively indexed on the core entity data table;LastModifiedDateis 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 indexedSystemModstamplets the delta query use the index and removes the scan.SystemModstampalso advances on every DB-level change (including cascade/system updates), so it is a superset-safe delta cursor relative toLastModifiedDatefor offline sync.Scope
LSConfig/lifeSciConfigRecord/lifeSciConfigRecords/in this PR. Other folders are handled separately.CONFIGURATION-type records are not delta-synced, so they were left unchanged even whereDeltaDateField = LastModifiedDate.<fieldValue>inside theDeltaDateFieldblock. No whitespace, no other field, no unrelated record touched.Per-entity verification method
Each candidate object was verified against a live LSC org (
sdb619) viasf sobject describe. An entity qualified only if its describe returned a field namedSystemModstampwithfilterable: true. All 161 DATA candidates passed both checks.Counts
DeltaDateField = LastModifiedDate)Skipped — CONFIGURATION type (left unchanged)
LifeSciDataChgDefRecType,LifeSciDataChgPersonaDef,ProviderActivityMeasureType,ProviderSampleLimitTemplate,PrvdClassificationLayout,PrvdClsfnAttrDefinition,PrvdClsfnLayoutAttributeEntities changed (161)
All rows: old =
LastModifiedDate, new =SystemModstamp,SystemModstamppresent = yes, filterable = yes.AccountAccountPlanAccountPlanObjectiveAccountPlanParticipantAccountPlanProductAccountPlanRelaObjAnalysisAccountPlanRelationshipAccountPlanStakeholderAccountPlanStkhldrActionAccountPlanStkhldrProductAcctPlanPtcpStakeholderActionPlanActionPlanItemActionPlanTemplateActionPlanTemplateAssignmentActionPlanTemplateItemActivityPlanActivityPlanTerritoryAddressAppAlertAppAlertTerritoryAppAlertUserResponseBusinessLicenseBusinessLicenseProductCareSpecialtyCaseCodeSetBundleCommSubConsentCmplSnpshtCommSubscriptionCommSubscriptionChannelTypeCommSubscriptionConsentComplianceStatementDefContactContactPointAddressContactPointBestContactTimeContactPointEmailContactPointPhoneContactPointSocialContentDocumentContentVersionDashboardDataUsePurposeDeviceSyncTransactionRecordDigitalSignatureEngagementChannelTypeEventEventRelationExpenseExpenseParticipantExpenseTypeFolderGoalAssignmentGoalDefinitionGoalDefinitionProductGroupHealthcareFacilityHealthcareProviderHealthcareProviderNpiHealthcareProviderSpecialtyHolidayInquiryInquiryQuestionInquiryQuestionAnswerLifeSciAccountListColumnLifeSciAccountListMemberLifeSciAcctListFilterCritLifeSciDataChangeDefLifeSciDataChangeRequestLifeSciDataChgDefMngFldLifeSciEmailTemplateLifeSciEmailTmplFragmentLifeSciEmailTmplRelaFrgmtLifeSciEmailTmplSnapshotLifeSciMarketableProductLifeSciProductAcctRstrcLifeSciStageActionLifeSciStageObjectLifeSciStageOperationLifeSciStageOperationActionLifeSciStageOperationCondnLifeSciStagePathLifeSciStageValueLifeScienceAccountListLifeScienceAccountListObjectLifeScienceCustomScriptLifeScienceEmailLocationMedicalInsightMedicalInsightAccountMedicalInsightProductObjectTerritory2AssociationPresentationPresentationClickStrmEntryPresentationForumPresentationLinkedPagePresentationPagePresentationPageProductPresentationPartyAccessProduct2ProductBatchItemProductDisbursementProductGuidanceProductItemProductTerrDtlAvailabilityProductTerritoryAvailabilityProductionBatchProviderAcctProductInfoProviderAcctTerritoryInfoProviderActivityGoalProviderActivityGoalMeasureProviderActvtyPlanAdjusmentProviderAffiliationProviderAffiliationProductProviderSampleLimitProviderSmplLmtTmplAssignmentProviderVisitProviderVisitDtlProductMsgProviderVisitMarketingItemProviderVisitProdDetailingProviderVisitProdDiscussionProviderVisitRqstSamplePrvdAccountTerritorySummaryPrvdAccountUserGroupInfoPrvdActvtyGoalMeasureProdtPrvdVstSmplLmtDiscrepancyPrvdVstSmplLmtTransactionRecordAlertRecordTypeReportSprintSubjectSubjectAssignmentSurveySurveyEngagementContextSurveyInvitationSurveyPageSurveyQstnResponseOfflineSurveyQuestionSurveyQuestionChoiceSurveyQuestionResponseSurveyResponseSurveyResponseOfflineSurveySubjectSurveyVersionTerritory2TerritoryAccountScoreTerritoryAcctProdMsgScoreTerritoryAcctRcmdActionTerritoryProdtQtyAllocationTerritoryUserDowntimeTimePeriodUserUserReactionUserTerritory2AssociationVideoCallVideoCallParticipantVideoCallPtcpRequestVideoCallPtcpSessionVideoCallRecordingVisitVisitorLinks