Are there any performance issues in using composit

2019-09-20 02:02发布

问题:

Does anybody knows any performance issues in using composite-ids, whether @EmbeddedId or @IdClass, with Hibernate?

Thanks.

回答1:

In my opinion, Hibernate itself does not have significant performance impact whether its a composite key or not. what matters is the dbms, engine type, queries, number of updates on table, indexes and types of columns. Hibernate will just be translating hql into sql, so in this case performance of hibernate should be good if underlying queries perform good....

here is a link, where there are good explanations regarding this issue as far as MySQL is concerned

Composite Primary Key performance drawback in MySQL