I've read on the various blogs and release notes that Hibernate Search 3.3 made lots of performance improvements, and some related to collections. But the wording is a little vague from what I've read. On Emmanuel's blog I see:
"if an entity changes in Hibernate Core but none of its indexed properties change, we won't trigger indexing anymore."
But what about if a particular property isn't changed? Right now I have a collection on an entity that isn't touched during a transaction, but another simpler property(integer) is. This property is loaded lazily. The depth on the collection property is also pretty deep, so the triggered joins can be expensive.
Its slightly more complicated than that since the property that is changed is directly on the entity being saved, while the collection that gets a load triggered is a within an entity referenced by the entity being saved. To be clear the model is:
Code:
class A{
@ManyToOne(fetch=FetchType.LAZY, cascade = {CascadeType.MERGE, CascadeType.PERSIST})
@IndexEmbedded(depth=5)
private B bee;
@Field
private Integer foo;
}
class B{
@ManyToMany(fetch=FetchType.LAZY,
cascade = { CascadeType.MERGE, CascadeType.PERSIST})
@JoinTable(
name="join_table",
joinColumns={@JoinColumn(name="some_col")},
inverseJoinColumns={@JoinColumn(name="som_col_2")}
)
@IndexedEmbedded(depth = 2)
private Set<C> cSet;
}
And we are essentially just doing the following with async indexing enabled:
Code:
A someA = session.get(id);
someA.setFoo(newValue);
sess.merge(someA);
So someA.bee is never touched. Yet the embedded indexing still happens even though we never dirtied bee. Re-indexing cSet is unnecessary and expensive.
In short my questions are:
1. Was this a known problem in hibernate search 3.2.X?
2. Will upgrading to 3.3.X for sure fix this?
I just want to ask on the forum first since the last time I toyed with the idea of upgrading core to 3.6 a lot of things broke, so it will take some effort to even try to upgrade, before I can even verify in reality that the performance improvements will be beneficial in this situation.
Thanks in advance!