Reputation: 73
I have a question about the performance difference between Integer and String discriminator types. I am using Joined strategy, namely :
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "DTYPE", discriminatorType = DiscriminatorType.STRING)
public abstract class SuperClass
and I have some sub classes which are extending this super class.
Which has a better performance? DiscriminatorType.INTEGER
or DiscriminatorType.STRING
?
Our provider is eclipselink and we are working on a massive volume of data.
Thanks in advance.
Upvotes: 0
Views: 454
Reputation: 1786
Normally using integer fields as the primary key column or index column or join would perform better if that is all you asking about.
But if you are really dealing with massive amount of data you may consider using SINGLE_TABLE instead of JOINED type inheritance if there are not many different attributes on the extending classes.
Because with JOINED type inheritance you need to do a extra join operation every time you need data. And also you should do 2 inserts for every insertion.
Upvotes: 2