问题
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
来源:https://stackoverflow.com/questions/7937149/are-there-any-performance-issues-in-using-composite-ids-with-hibernate