Documentation / Under the hood
The matching run, stage by stage
Stage A (match), stage B (golden build), decisions and stable ids.
Stage A – per resource type, masters first
- Scan: the type's source records are read page by page.
- Blocking and pair scoring as in How a pair is scored; relationship attributes compare the golden entity a reference points to, which is known because masters were clustered earlier.
- Steward decisions are applied: a stored merge forces records together, a stored not a match keeps them apart (even against an automatic score).
- Clustering: automatic and approved pairs are joined with union-find into clusters.
- Persist: clusters keep stable ids; clusters keep their ids when members are added, and when two clusters merge the absorbed one is retired but remembered ("merged golden ids").
Stage B – golden build
- References of every member are rewritten to golden ids; merged targets collapse into the surviving golden resource; references that cannot be resolved become reference issues.
- Survivorship picks the value per element.
- Bookkeeping is added: id
gld-<type>-<cluster>, tag golden-record, one source-record identifier per member, thegolden-sourcesextension, and Patient.link refer. - The result is written by the batch loader; unchanged content is not rewritten (hashdiff), so reruns are cheap.
When a steward decides, only the clusters involved are rebuilt (incrementally), not the whole type.
NoteLimits: one resource type is held in memory at a time; deletes in the raw vault are not tracked; golden writes are chunked at 400 resources per transaction.