I've many pairs of tables and I want to efficiently determine which pairs have tables that are related to each other by PK-FK relationships.
- If PK-FK relationship is documented, I'll leverage that but I cannot assume that it's always documented. (For example, if the source is flat file etc.)
- In cases where it's not documented, I need a way to efficiently determine if the two tables are related.
- I'll need to work with composite keys if the tables in the pair is not related by non-composite keys.
What I'm looking for is one of below things:
- Any existing algorithm.
- Any research paper.
- Any ideas/pointers.
- Any of similar works available online.
- Book suggestions etc.
For Example:
Suppose I've below pairs of tables:
{Table1, Table2}
{Table3, Table4}
{Table5, Table6}
and many more...
Out of the above pairs, I want to return the pair {Table3, Table4}
if the tables Table3 and Table4 are related to each other by PK-FK relationship. To return the correct pair I need an efficient way to determine if the tables are related or not (assuming the relationship is not documented).
NOTE: I'm looking for data based discovery for PK-FK relationships between the tables and not just metadata based discovery (because in some cases metadata may not be available).
Many thanks in advance.