============================================================ nat.io // BLOG POST ============================================================ TITLE: A Part Number Is Not a Primary Key DATE: November 24, 2026 AUTHOR: Nat Currier TAGS: Data Engineering, Software Architecture, Search ------------------------------------------------------------ A buyer types `DH482L`. The catalog has a record for `DH-482L`. The two strings look close enough that I’d want the search to find the record. I’d still stop short of telling the buyer to order it. The buyer needs a left-front door handle in satin black for a 2018 Model Q Touring. In this fictional catalog, Maker A offers that exact replacement. Maker B uses the same normalized code for a right-front handle for the same vehicle. Distributor C uses the same text as its own stock code for an unpainted restoration part that may need bracket work. A fourth record offers a keyless upgrade that depends on a connector the buyer hasn’t mentioned. I ran into this distinction while prototyping a catalog matcher. Getting a search result was the easy part. The difficult part was deciding what the result justified saying. Removing a hyphen made the candidate set easier to find. If I let that cleaned string stand for the product, it also gave independent records a single identity. The error could survive a superficial test because the model year, appearance, and part-number shape all looked plausible. > **Thesis:** A normalized part number can find candidates, but a purchase recommendation needs evidence for identity, fitment, and replacement. > **Why now:** A catalog can return a convincing result before it has resolved a manufacturer collision or a vehicle-specific requirement. > **Who should care:** Engineers and product teams building catalog search, fitment checks, or buying assistants. > **Bottom line:** Preserve the source identifier and its namespace, then make the next action depend on the evidence available. [ Give the identifier a scope ] ------------------------------------------------------------ In database terms, a primary key uniquely identifies a row. A manufacturer-issued code can be a useful key within a namespace where the issuer guarantees uniqueness. Across makers, distributors, or different identifier types, the same value may legitimately occur more than once. A database can enforce uniqueness across several columns, so there’s no need to squeeze the whole identity into the spelling of one field. I’d record the issuing namespace, identifier type, and original value, then index a normalized form separately for candidate retrieval. [PostgreSQL constraints documentation](https://www.postgresql.org/docs/current/ddl-constraints.html) I’d also preserve the distinction between a formatting transformation and a product relationship. Stripping a hyphen is a transformation on text. An equivalent part or a newer replacement is a claim that needs its own source. If the search layer collapses both operations into one alias, it becomes hard to recover why a record ever appeared in the result. [ Ask what the evidence establishes ] ------------------------------------------------------------ The table below uses only invented records. Each could show up in a broad search for the buyer’s request. What changes is the claim the answer can safely make. | Candidate | What the record establishes | What the answer can say | | --- | --- | --- | | Maker A, `DH-482L` | Documented left-front satin-black direct replacement for a 2018 Model Q Touring, requiring no modification | Recommend when the vehicle configuration and the intended maker or original part are confirmed | | Maker B, `DH482L` | Right-front satin-black part for the same vehicle | Exclude for this request because the side conflicts | | Distributor C, stock code `DH482L` | Unrelated unpainted restoration part, with possible bracket work | Leave out of the direct-replacement answer | | Maker D, `Q-KEYLESS-L` | Newer optional upgrade that requires a compatible connector | Offer only as a conditional upgrade if the buyer wants it | Fitment and product information are distinct concerns in the automotive aftermarket as well. The Auto Care Association publishes ACES for communicating application and fitment data and PIES for communicating product information. A fitment relationship can tell me which vehicle a part is documented to serve. The product record and its supporting evidence still have to settle the finish, installation conditions, and type of replacement the buyer asked for. [Auto Care ACES](https://www.autocare.org/aces) · [Auto Care PIES](https://www.autocare.org/pies) [ Return an answer that matches the evidence ] ------------------------------------------------------------ If the only input is `DH482L`, the result is ambiguous. I’d show the distinct candidates or ask for the maker and vehicle details. If the request supplies enough information to rule out the conflicts and a direct-fit record covers every material constraint, I’d recommend the verified match and include its source. If the only remaining candidate depends on an unverified connector or trim, I’d abstain from a purchase recommendation and name the missing fact. The same rule applies when the system can retrieve only one candidate. A singleton result can be a consequence of what the index contains, which fields it searches, or which catalog feed was available. I want a separate check that verifies the candidate against the buyer’s requirements. The number of rows returned by a query can’t do that work by itself. For a regression test, I’d keep the four records in one fixture. The bare code should retain collision information. Adding the documented configuration and intended part should resolve the match. Substituting the right-hand side should change the answer even if the top lexical candidate stays the same. Changing the request to an upgrade without supplying the connector should produce a useful clarification. That exercise makes the difference between ranking and authorization visible in the product. [ What transfers ] ------------------------------------------------------------ A search field and a purchase decision have different jobs. I’d keep tolerant matching where it helps people find records and require evidence at the point where the system recommends an action. There’s room for a forgiving query and a careful answer in the same system. The same constraint applies to discovery outside a catalog. Finding a record is only one step toward helping someone do what they came to do. [The Destination Is No Longer a Website. It Is an Outcome.](https://nat.io/blog/ai-discoverability-from-search-to-outcomes)