Using Counts and Sample Reads to Check Persisted State
A consistency check can combine totals, stable identities, relationships, and a known example to verify an operation's effects.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace a catalog extension
Count expected new rows and confirm the previous IDs still resolve. Read a representative new row with a related record to test its reference. Data migration queries provide specific checks.
Check at the right time
Measure after the relevant commit, and separate asynchronous indexing if it has its own timing. Asynchronous writes explain why an immediate consumer may see a different stage.[1]
Verify coverage and data accuracy separately
A batch migration should update forty out of fifty rows. Counting forty changed rows checks coverage, while comparing selected IDs and values detects wrong transformations or selecting the wrong records. Include representative excluded rows. See SQL checks for a data migration.
Expected population: 50
Expected updated: 40
Compare IDs against the intended predicate
Verify first, last and exceptional values
Reconcile mismatches before declaring completion
Equal totals can hide errors that cancel. Compare unchanged and changed groups in the appropriate snapshot. Keep the queries and their parameters reproducible for the final deployment check.