I have 2 tables, entity_A and entity_B.
entity_A has a field that links to one or more records in entityB.
entity_B has only a handful of records (say 20), while entity_A has a few thousand.
What is the best way to design for this? It doesn't seem to make sense to have entity_B have an entity_A_id field, as multiple records in entity_A would require linkage to the same entity_B record. In this case, entity_B would be many times larger than entity_A, with a LOT of redundant information (as I say, a few thousand records instead of just 20).
Currently, the system maintains an object for each entity_A record. The object is serialised and stored in the database. When it needs to be retrieved, it is unserialised. The entity_B table, is only used for ease-of-use for the user; displaying a form with a list of entity_B records and an "Add" button.
The big problem with this approach is that the entity_B data is not easily searchable.
Any ideas?
entity_A has a field that links to one or more records in entityB.
entity_B has only a handful of records (say 20), while entity_A has a few thousand.
What is the best way to design for this? It doesn't seem to make sense to have entity_B have an entity_A_id field, as multiple records in entity_A would require linkage to the same entity_B record. In this case, entity_B would be many times larger than entity_A, with a LOT of redundant information (as I say, a few thousand records instead of just 20).
Currently, the system maintains an object for each entity_A record. The object is serialised and stored in the database. When it needs to be retrieved, it is unserialised. The entity_B table, is only used for ease-of-use for the user; displaying a form with a list of entity_B records and an "Add" button.
The big problem with this approach is that the entity_B data is not easily searchable.
Any ideas?