I want to create a table that will act as a lookup table for an application.
The format I have in mind is something like:
CREATE TABLE Associations (
obj_id int unsigned NOT NULL,
attr_id int unsigned NOT NULL,
assignment Double NOT NULL
PRIMARY KEY (`obj_id`, `attr_id`),
);
Anyway I have the following question:
The idea is that this table will be loaded/used in the application level as a map:
obj_id -> listof(<attr_id, assignment>)
The obj_id
refers to another table which is huge. Now this means that Associations
will be x times
the original table since we'll have multiple rows for each obj_id
.
Taking into account that I don't really need to SELECT in the table by assignment
and at this point I also don't need to SELECT by attr_id
is there another design approach for the table that could be more efficient?