Merging tables with a 1 to 1 relationship in a database

database-design

Is it a good idea to merge two tables that have a 1..1 relationship together?

I have inherited a database with too many tables linked together in a 1..1 relationship. I'd like to evaluate the benefits of merging these tables where possible to have more tidy model with higher query performance.

For example table t1 has 150 records and table t2 has 150 records, they each contain 5 columns and these two tables have a 1..1 relationship. Would it be a good idea to merge them into one table, say t3 which contains all the columns from t1 and t2?

Also does it make any difference if these tables are reference tables (less than 200 records) or an operational tables?

Any idea is appreciated.

Best Answer

If they are small reference tables then I would be more inclined to merge them than if they are not. If reference tables, then they are likely separated due to over the top normalisation and merging them makes séance from query performance perspective.

If they were large fact tables I would be less inclined to wade in before checking ramifications, as it could be that they were separated onto separate file groups with files on different spindles for parallel operations. If this is the case however, I would still be inclined to merge them, and consider table partitioning.

Either way, be sure to thoroughly check for Database and client application dependencies before Changing the table structure.