ULDA v6.0 — Live Database Walkthrough

Generated 2026-07-16 from live read-only introspection of leads_db. Sample rows are masked (names→initials, emails/phones redacted). Legacy public.leads is untouched.

1,064,189
golden identities
5
ULDA schemas
116
objects (tables/views/MVs)
78
primary keys
55
foreign keys
150
indexes

1 · The five schemas

SchemaTablesViewsMViewsPurpose
ulda_events1010Append-only event ledger (what HAPPENED — dispositions, comms, activity), monthly-partitioned.
ulda_gov1870Governance: data-quality findings, match review, consent, lineage, decommission control plane.
ulda_master4330Golden identity spine + mastered business entities (the source of truth for WHO a lead is).
ulda_ref140Reference data as zero-movement curated views (serviceability, geo) — shared, effective-dated.
ulda_serve10144Serving/AI layer: Lead-360, feature store, scoring, pgvector search, metrics, reverse-ETL.

2 · How data flows

  SOURCES                RESOLUTION                 GOLDEN SPINE (ulda_master)
  public.leads  ─┐
  b2c           ─┼─► norm_email/phone/name ─► source_crosswalk ─► identity_registry
  ad_leads      ─┘     (blocking + det/prob      (source_id ↦        (master_lead_id = the
                        + pgvector match)          master_lead_id)     universal key)
                                                        │
        borderline ─► ulda_gov.match_review             ├─► person        (golden, survivorship)
        defects    ─► ulda_gov.dq_finding               ├─► contact_point (emails/phones)
                                                        ├─► lead / company / address
                                                        └─► consent  (TCPA gate)
                                                        │
  live writes ─► trg_leads_dualwrite ─► ulda_gov.change_outbox ─► drain worker
                                                        │
                                       ulda_serve: mv_lead_360 · features · score · pgvector · metrics
                                                        └─► reverse-ETL ─► operational apps

One master_lead_id ties together every source row, the golden person, all contact points, the lead state, and consent. Everything downstream keys off it.

3 · Core tables — structure & masked samples

ulda_master.identity_registry 1,064,189 rows

The registry — one row = one real person/lead. `master_lead_id` is the universal key everything hangs off.

ColumnType
master_lead_id PKuuid NOT NULL
statustext NOT NULL
merged_intouuid
created_attimestamp with time zone NOT NULL
updated_attimestamp with time zone NOT NULL
primary_person_iduuid
canonical_hashtext

PK: PRIMARY KEY (master_lead_id) · 2 FK · 2 idx

master_lead_idstatusprimary_person_idcanonical_hashcreated_at
cb10be81…active2026-07-15T13:33:25+02:00
93495702…active2026-07-16T14:18:13+02:00
000008eb…activebbbcfc2a…874b94b20f…2026-07-13T19:49:00+02:00
00000b61…active1f55d5c4…d75e9493fb…2026-07-13T19:49:00+02:00
00005ad6…active5b4ee03b…5b67ddd372…2026-07-13T19:49:00+02:00
0000753a…active5159e6ad…28bd7afece…2026-07-13T19:49:00+02:00

ulda_master.source_crosswalk 1,074,066 rows

Maps every source row (leads/b2c/ad_leads) to its master_lead_id. UNIQUE(source_system,source_id) prevents double-mastering.

ColumnType
crosswalk_id PKbigint NOT NULL
master_lead_iduuid NOT NULL
source_systemtext NOT NULL
source_idtext NOT NULL
match_methodtext
confidencenumeric
created_attimestamp with time zone NOT NULL

PK: PRIMARY KEY (crosswalk_id) · 1 FK · 3 idx

crosswalk_idmaster_lead_idsource_systemsource_idmatch_methodconfidence
11d775bc4…leads***024deterministic1.0
26c62b357…leads***899deterministic1.0
3b9f3131c…leads***418deterministic1.0
454caaed3…leads***047deterministic1.0
5bf4b8307…leads***159deterministic1.0
6741ae347…leads***083deterministic1.0

ulda_master.person 1,064,187 rows

Golden person record (survivorship-picked), bitemporal (valid_from/valid_to/is_current).

ColumnType
person_id PKuuid NOT NULL
master_lead_iduuid NOT NULL
full_nametext
first_nametext
last_nametext
created_attimestamp with time zone NOT NULL
updated_attimestamp with time zone NOT NULL
valid_fromtimestamp with time zone
valid_totimestamp with time zone
is_currentboolean NOT NULL
system_fromtimestamp with time zone NOT NULL

PK: PRIMARY KEY (person_id) · 1 FK · 2 idx

person_idmaster_lead_idname_maskedis_currentvalid_from
53d3999f…ca6c9265… True2026-07-14T08:38:19+02:00
1105e43d…0343447e…A. E.True2026-07-14T08:38:19+02:00
912dba1e…07f4e31d… True2026-07-14T08:38:19+02:00
acba1e4b…03f48434… True2026-07-14T08:38:19+02:00
3b289c72…0098e241…K. M.True2026-07-14T08:38:19+02:00
eb9de5fa…02fd43d4…E. G.True2026-07-14T08:38:19+02:00

ulda_master.contact_point 1,875,193 rows

All emails/phones per identity, normalized, primary-flagged.

ColumnType
contact_point_id PKuuid NOT NULL
master_lead_iduuid NOT NULL
kindtext NOT NULL
valuetext NOT NULL
value_normtext
is_primaryboolean
created_attimestamp with time zone NOT NULL
valid_fromtimestamp with time zone
valid_totimestamp with time zone
is_currentboolean NOT NULL
system_fromtimestamp with time zone NOT NULL

PK: PRIMARY KEY (contact_point_id) · 1 FK · 3 idx

master_lead_idkindvalue_maskedis_primaryis_current
6a292b10…emailj***@prol.wsTrueTrue
c7c7fadb…emaily***@TrueTrue
0ae0d444…emailn***@wisc.eduTrueTrue
012d258b…emailr***@TrueTrue
0918b9f2…emailg***@TrueTrue
0e132a07…emaild***@mvn.comTrueTrue
0e80f352…emailk***@cco.comTrueTrue
148820d9…emaile***@TrueTrue

ulda_master.lead 1,064,187 rows

The lead/opportunity state per identity, bitemporal.

ColumnType
lead_id PKuuid NOT NULL
master_lead_iduuid NOT NULL
statustext
stagetext
source_systemtext
created_attimestamp with time zone NOT NULL
updated_attimestamp with time zone NOT NULL
valid_fromtimestamp with time zone
valid_totimestamp with time zone
is_currentboolean NOT NULL
system_fromtimestamp with time zone NOT NULL

PK: PRIMARY KEY (lead_id) · 1 FK · 2 idx

lead_idmaster_lead_idstatusstagesource_systemcreated_at
70286374…1d775bc4…leads2026-07-14T08:50:08+02:00
a7cc020d…6c62b357…leads2026-07-14T08:50:08+02:00
2399f935…b9f3131c…leads2026-07-14T08:50:08+02:00
91d42e29…54caaed3…leads2026-07-14T08:50:08+02:00
d71fb5db…bf4b8307…leads2026-07-14T08:50:08+02:00
2ef6db6e…741ae347…leads2026-07-14T08:50:08+02:00

4 · Full object inventory (per schema)

ulda_events

ObjectKindRowsIdxFK
disposition_eventpart20
disposition_event_2026_05tbl20
disposition_event_2026_06tbl≈5,63920
disposition_event_2026_07tbl≈2,70420
disposition_event_2026_08tbl20
disposition_event_2026_09tbl20
disposition_event_2026_10tbl20
disposition_event_2026_11tbl20
disposition_event_2026_12tbl20
disposition_event_2027_01tbl20
disposition_event_defaulttbl20
v_events_healthview00

ulda_gov

ObjectKindRowsIdxFK
attribute_lineagetbl10
catalog_datasettbl10
change_outboxtbl≈620
consent_keytbl11
data_catalogtbl10
decommission_baketbl10
decommission_logtbl10
decommission_registrytbl10
dq_findingtbl≈189,40710
dualwrite_errortbl10
ir_audittbl20
ir_runtbl10
legacy_dependencytbl20
llm_guardrailtbl10
match_reviewtbl≈302,15910
pii_classificationtbl10
recon_baselinetbl10
retention_policytbl10
v_decommission_statusview00
v_dependency_resolution_planview00
v_ir_reconciliationview00
v_legacy_dependency_driftview00
v_pii_summaryview00
v_registry_integrityview00
v_ulda_healthview00

ulda_master

ObjectKindRowsIdxFK
accounttbl≈440,94012
addresstbl440,94030
agenttbl42
agent_territorytbl12
blocking_keytbl≈3,275,51130
campaigntbl≈6611
campaign_membershiptbl≈454,73122
casetbl35
channeltbl20
companytbl668,50420
consenttbl8,07743
contact_pointtbl1,875,19331
documenttbl23
golden_fieldtbl≈6,965,04010
golden_record_cleanview00
golden_record_fulltbl≈1,063,08521
golden_record_legacy_deprecatedtbl≈1,064,18711
householdtbl≈440,94011
identity_keytbl≈1,064,18710
identity_registrytbl1,064,18922
interactiontbl35
ir_attrtbl≈1,074,30630
ir_block_mastertbl≈2,437,85410
ir_eligible_blocktbl≈228,22710
ir_emb_scopetbl≈84,33400
ir_master_attrtbl≈1,064,18710
ir_master_keytbl≈1,064,18710
ir_pairtbl≈1,571,45500
ir_pair_scoredtbl≈1,571,45500
ir_signaltbl≈1,074,06420
leadtbl1,064,18721
match_candidatetbl30
merge_logtbl20
opportunitytbl46
ordertbl33
order_linetbl32
persontbl1,064,18721
person_address_residencytbl≈664,77212
person_company_employmenttbl≈912,08122
producttbl20
source_crosswalktbl1,074,06631
survivorship_ruletbl10
teamtbl22
territorytbl20
v_consent_gateview00
v_master_entitiesview00

ulda_ref

ObjectKindRowsIdxFK
reference_catalogtbl10
v_address_coverage_360view00
v_address_serviceabilityview00
v_fcc_coverageview00
v_geo_address_rangeview00

ulda_serve

ObjectKindRowsIdxFK
consumer_cutovertbl10
consumer_cutover_logtbl10
lead_embeddingtbl≈20021
metric_catalogtbl10
model_registrytbl10
mv_lead_360mv≈1,064,18860
mv_lead_featuresmv≈1,064,18720
mv_lead_scoremv≈1,064,18720
mv_metricsmv≈1210
mv_refresh_logtbl≈10720
reverse_etl_runtbl11
reverse_etl_targettbl10
score_runtbl11
serving_slatbl10
v_activation_360view00
v_activation_consentedview00
v_activation_high_intentview00
v_analytics_by_sourceview00
v_analytics_by_stateview00
v_analytics_by_tierview00
v_analytics_kpiview00
v_cutover_statusview00
v_lead_360view00
v_lead_embedding_inputview00
v_lead_llm_safeview00
v_lead_scoreview00
v_metricsview00
v_serving_healthview00

5 · Relationships (foreign keys)

55 FKs enforce referential integrity across the model. Every master entity ultimately references identity_registry(master_lead_id).

TableConstraint
ulda_gov.consent_keyFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.accountFOREIGN KEY (master_company_id) REFERENCES ulda_master.company(master_company_id)
ulda_master.accountFOREIGN KEY (household_id) REFERENCES ulda_master.household(household_id)
ulda_master.agentFOREIGN KEY (territory_id) REFERENCES ulda_master.territory(territory_id)
ulda_master.agentFOREIGN KEY (team_id) REFERENCES ulda_master.team(team_id)
ulda_master.agent_territoryFOREIGN KEY (agent_id) REFERENCES ulda_master.agent(agent_id) ON DELETE CASCADE
ulda_master.agent_territoryFOREIGN KEY (territory_id) REFERENCES ulda_master.territory(territory_id) ON DELETE CASCADE
ulda_master.campaignFOREIGN KEY (channel_id) REFERENCES ulda_master.channel(channel_id)
ulda_master.campaign_membershipFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.campaign_membershipFOREIGN KEY (campaign_id) REFERENCES ulda_master.campaign(campaign_id)
ulda_master.caseFOREIGN KEY (lead_id) REFERENCES ulda_master.lead(lead_id)
ulda_master.caseFOREIGN KEY (assigned_agent_id) REFERENCES ulda_master.agent(agent_id)
ulda_master.caseFOREIGN KEY (person_id) REFERENCES ulda_master.person(person_id)
ulda_master.caseFOREIGN KEY (account_id) REFERENCES ulda_master.account(account_id)
ulda_master.caseFOREIGN KEY (channel_id) REFERENCES ulda_master.channel(channel_id)
ulda_master.consentFOREIGN KEY (person_id) REFERENCES ulda_master.person(person_id)
ulda_master.consentFOREIGN KEY (channel_id) REFERENCES ulda_master.channel(channel_id)
ulda_master.consentFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.contact_pointFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.documentFOREIGN KEY (account_id) REFERENCES ulda_master.account(account_id)
ulda_master.documentFOREIGN KEY (opportunity_id) REFERENCES ulda_master.opportunity(opportunity_id)
ulda_master.documentFOREIGN KEY (order_id) REFERENCES ulda_master."order"(order_id)
ulda_master.golden_record_fullFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.golden_record_legacy_deprecatedFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.householdFOREIGN KEY (master_address_id) REFERENCES ulda_master.address(address_id)
ulda_master.identity_registryFOREIGN KEY (merged_into) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.identity_registryFOREIGN KEY (primary_person_id) REFERENCES ulda_master.person(person_id)
ulda_master.interactionFOREIGN KEY (person_id) REFERENCES ulda_master.person(person_id)
ulda_master.interactionFOREIGN KEY (campaign_id) REFERENCES ulda_master.campaign(campaign_id)
ulda_master.interactionFOREIGN KEY (channel_id) REFERENCES ulda_master.channel(channel_id)
ulda_master.interactionFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.interactionFOREIGN KEY (agent_id) REFERENCES ulda_master.agent(agent_id)
ulda_master.leadFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.opportunityFOREIGN KEY (account_id) REFERENCES ulda_master.account(account_id)
ulda_master.opportunityFOREIGN KEY (campaign_id) REFERENCES ulda_master.campaign(campaign_id)
ulda_master.opportunityFOREIGN KEY (lead_id) REFERENCES ulda_master.lead(lead_id)
ulda_master.opportunityFOREIGN KEY (owner_agent_id) REFERENCES ulda_master.agent(agent_id)
ulda_master.opportunityFOREIGN KEY (person_id) REFERENCES ulda_master.person(person_id)
ulda_master.opportunityFOREIGN KEY (product_id) REFERENCES ulda_master.product(product_id)
ulda_master.orderFOREIGN KEY (agent_id) REFERENCES ulda_master.agent(agent_id)
ulda_master.orderFOREIGN KEY (account_id) REFERENCES ulda_master.account(account_id)
ulda_master.orderFOREIGN KEY (opportunity_id) REFERENCES ulda_master.opportunity(opportunity_id)
ulda_master.order_lineFOREIGN KEY (product_id) REFERENCES ulda_master.product(product_id)
ulda_master.order_lineFOREIGN KEY (order_id) REFERENCES ulda_master."order"(order_id) ON DELETE CASCADE
ulda_master.personFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.person_address_residencyFOREIGN KEY (address_id) REFERENCES ulda_master.address(address_id)
ulda_master.person_address_residencyFOREIGN KEY (person_id) REFERENCES ulda_master.person(person_id)
ulda_master.person_company_employmentFOREIGN KEY (person_id) REFERENCES ulda_master.person(person_id)
ulda_master.person_company_employmentFOREIGN KEY (master_company_id) REFERENCES ulda_master.company(master_company_id)
ulda_master.source_crosswalkFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_master.teamFOREIGN KEY (manager_agent_id) REFERENCES ulda_master.agent(agent_id) ON DELETE SET NULL
ulda_master.teamFOREIGN KEY (parent_team_id) REFERENCES ulda_master.team(team_id)
ulda_serve.lead_embeddingFOREIGN KEY (master_lead_id) REFERENCES ulda_master.identity_registry(master_lead_id)
ulda_serve.reverse_etl_runFOREIGN KEY (target) REFERENCES ulda_serve.reverse_etl_target(target)
ulda_serve.score_runFOREIGN KEY (model_id) REFERENCES ulda_serve.model_registry(model_id)

6 · ULDA vs the original public.leads

Original · public.leads

  • 1 flat table, ~995K rows, raw as-ingested
  • Same person = many unrelated rows
  • Mixed formats, defects inline, no dedup
  • No consent/TCPA gate, no governance
  • Direct table reads by apps
  • Untouched & authoritative — byte-for-byte preserved

New · ULDA golden layer

  • 5 schemas, 116 objects, 1.06M deduplicated golden identities
  • One master_lead_id per real person
  • Normalized + survivorship-picked values, bitemporal history
  • Consent gate (8,077 blocked), DQ findings (189K), match review (302K)
  • Lead-360 + feature store + scoring + pgvector search
  • Additive & reversible — built alongside, legacy never modified
Key point: ULDA did not rewrite public.leads. It built a clean, mastered layer beside it — dedup ratio 1.0093 (1,074,066 source rows → 1,064,189 identities), email rate 98.35%, contactable 100%, all invariants 0/0/0.

Interactive explorer (search any lead, run read-only SQL): ULDA Live Explorer →