PIM-2372: Remove useless parts to get common attributes
PIM-2372: Optimize query to get common attributes in ORM