Legacy schema traps · Keys and relations
My ERP database has no foreign keys. How do I know what joins to what?
Most legacy databases declare few or no foreign keys, so the schema cannot tell you. The relations live in the application code and in naming habits, and have to be inferred from names and overlapping values, then confirmed.
What it looks likeIllustrative
ORDLIN.ITEM points to ITEM.ITEMNO, but nothing in the schema says so, and ORDLIN.ITEM2 points somewhere else.
All table and column names are invented.
Why reports and AI agents get it wrong
It guesses relations from names and joins the first plausible pair.
A first check you can run
List columns that share a name or a suffix across tables and compare their value ranges and lengths.
Read-only and on the catalogue or aggregates: it looks at structure and value counts, not at individual records.
How Janus Works handles it
Relations are inferred from names, value overlap and aggregates, then confirmed, not assumed.
Every number verified against your own screens. Deviations shown, never hidden.