medium impactPRODUCTIONAMPscript

LookupRows() Stops at 2,000 Rows

A loop over LookupRows() appears to “randomly” miss records in a one-to-many dataset.

Context Pack →Open Workspace →
Trust & provenancePRODUCTION
Evidence tierPRODUCTIONOfficial sources1Other sources0Last verifiedNot recorded

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.

Why it bites

LookupRows() returns an unordered rowset with a maximum of 2,000 rows.

What to check
  1. Could the lookup key match more than 2,000 rows?
  2. Does business logic actually require processing that many rows at render time?
Make it cheaper next time
  1. Use bounded lookup patterns in message rendering.
  2. Precompute large relationships in SQL or external processing instead of iterating huge rowsets during send.
ampscriptlookuprowslimitperformance
Sources / verification