Hi there, I'm aware of several question on this forum relating to this. But I'm not talking about splitting tables for the same entity (like user for example)
Suppose I have a huge options table that stores list options like Gender, Marital Status, and many more domain specific groups with same structure. I plan to capture in a OPTIONS
table.
Another simple option is to have the field set as ENUM, but there are disadvantages of that as well. http://www.brandonsavage.net/why-you-should-replace-enum-with-something-else/
OPTIONS
Table:
option_id <will be referred instead of the name>
name
value <more like a description, and not a name/value pair>
group
Query: select .. from options where group = '15'
Usage: Gender & Marital_Status will be in the Persons tables; however the value stored will come from Options
eg.
Person
..
id=34 name=Prasad gender=31 marital_status=41
..
Options
..
31 gender male male
32 gender female female
...
41 marital_status single single
42 marital_status married married
..
- Since this table is expected to be multi-tenant, the no of rows could grow drastically.
- I believe splitting the tables instead of finding by the group would be easier to write & faster to execute.
- or perhaps partitioning by the group or tenant?
Pl suggest. Thanks