sfmc // SQLPRODUCTION
SARGable Rolling Date Window
Filter recent Data View rows without wrapping the source date column in a function.
sqlperformancedateaddsargable
Trust & provenancePRODUCTION
Evidence tierPRODUCTIONOfficial sources1Other sources0Last verified2026-10-05
Evidence tier describes my hands-on relationship with the content. Official sources describe platform contracts/documentation. Production observations should not automatically be treated as official limits.
Filtering large Data Views or Data Extensions by a recent time window.
SELECT
SubscriberKey,
JobID,
EventDate
FROM _Sent
WHERE EventDate >= DATEADD(day, -30, GETDATE())The source column remains directly searchable while the boundary is calculated once on the other side of the predicate.
Salesforce calls non-SARGable predicates a common timeout pattern in Query Activities.
Avoid patterns such as DATEDIFF(day, EventDate, GETDATE()) <= 30 on large sources.