I use polymorphic object structures, but every object is stored in it's own table, i.e. user, product, category, event, etc.
As far as the proposed ass table, it will only have 4 functional fields, with very straightforward datatypes (plus one
ai_colas primary). The datatypes would be varchar(10) for thetypecols and CHAR(32) / BINARY(16) for the id's. SELECT's will only ever have one join, to the ass table, i.e.SELECT event.* FROM event INNER JOIN ass ON ass.obj_1_type = 'event' AND ass.Object_ID_1 = event.Event_ID AND ass.obj_2_type='location'
SELECT event.* FROM event INNER JOIN ass ON ass.obj_1_type = 'event' AND ass.Object_ID_1 = event.Event_ID AND ass.obj_2_type='location'