Back to glossary

Primary Key

A primary key is the unique identifier that distinguishes one record from every other in the same table — the anchor that joins, dedupes, and updates depend on.

What is a primary key?

A primary key is the column (or combination of columns) that uniquely identifies each row in a database table. Every row must have a value, no two rows can share the same value, and the value should never change once set. In GTM data, the primary key is what makes deduplication, cross-system joins, and idempotent updates possible.

Why it matters

  • Without a stable key, "the same lead" across systems is unknowable
  • Joins between tables (contacts ↔ accounts ↔ opportunities) all depend on keys
  • Updates and upserts require a key to know whether to insert or modify

Natural vs. surrogate keys

  • Natural: a value that already identifies the entity (work email, account domain)
  • Surrogate: a system-generated ID (UUID, auto-increment integer)
  • Best practice: use surrogate as the primary key + index natural keys for matching

In GTM data

  • Contacts: surrogate ID + work email as a unique secondary key
  • Accounts: surrogate ID + normalized domain as the cross-system anchor
  • Opportunities: surrogate ID + (account, deal name) as a soft-unique pair

How TexAu helps

Use stable keys (work email, normalized domain) inside TexAu workflows for dedup, identity resolution, and CRM upserts — every row written downstream maps to exactly one canonical record.

Related