Generalisation Performance

Hi, I would like to know what the impact of a generalisation is on the performance, for example: Entity Car (attrib. name and licencenumber) Entity Road generalisation Car (attrib type and miles) Entity Engine generalisation Car (attrib Hp) If i acces Road do i alsow access Engine ? Does the Mx Engine create a virtual table with name, licencenumber, type, miles, Hp or name, licencenumber, Hp. Thanks in advance
2 answers

If you access entity car you will have access to Road and Engine types also, you will need to cast the entity to determine the type.

If you access entity Road you don't have access to Engine, same goes the otherway around.

Generalization has a impact on performance, try minimizing generalization usage.


Firstly, I would like to clarify some points about your example.

If a Car is your generalized entity, then a Jeep, or a Mercedes would be a Specialization. Why? Because all cars have 4 wheels and a steering wheel, but a Jeep might have a convertible top, and a Mercedes might have Bluetooth.

The point of specialization is that only attributes specific to that type are available on the entity.

A road is not related to a car, other than the fact that the car drives on the road.

Secondly, when you do create specialized entities, only the attributes for that entity are stored on a table.

When you create a specialized entity, TWO records are created in the database (one for the generalization, one for the specialization - the SubMetaObject column is used to determine the generalization).

That being said a table is created for your General Entity, and subsequent tables encapsulating the different attributes are created for each Specialized Entity.

Performace-wise, pulling the general entity is a single table select, whereas the specialized entity will have to JOIN to the general entity's table.