MySQL Forums
Forum List  »  Newbie

When to move data to a relational table
Posted by: Michael Botsko
Date: January 23, 2022 09:00PM

Say I have a list of 100 "thing names" (max length ~55 characters). This list is fairly static and is unlikely to change much and I never need to store any additional info about "things", just their names.

Say I need to reference a "thing name" in a table that will eventually have 50 million records.

I can either make a column for `thing_name` and just store the name directly, OR I can make a new table for `thing_id`, `thing_name` and always lookup the ID when I need to INSERT data, and JOIN the table when I need to lookup data.

In this scenario, which is best? Sure I can save some space by using TINYINT instead of VARCHAR(55) in the huge table, but I'm now adding the overhead of inserting/joining relational data too.

It seems to me like I'll increase the disk footprint of the large table but save those extra queries.

Options: ReplyQuote


Subject
Written By
Posted
When to move data to a relational table
January 23, 2022 09:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.