We're updating the issue view to help you get more done. 

Query pulling back unnecessary objects when embedded object gets updated and resulting in performance issue

Description

We have been having serious performance issues caused by updating fields in an embedded object. Specifically, we are using a class structure where "Account" is embedded in "User" is embedded in "Lesson", both of these associations being marked with the "@IndexedEmbedded(includePaths {**********})" notation on the owner side, with "@ContainedIn" marking the owned side. Paths specified are only one level deep and do not point to the described associations. When trying to update a field in "Account", Hibernate Search is making inefficient and unnecessary database queries:

1. Pulling back unnecessary objects
When updating an account, Hibernate Search tries to pull back both Users and Lessons, even though no change occurs in any fields accessible by Lesson(example Query 1 in attachments).

2. Inefficient Query
Hibernate Search gets user from account and then gets account from user (Query 2 in attachments).

We have tried several permutations of "includePaths" and "depth =" specifications, none of which have solved the issue.

Environment

4.4.4.Final, Mysql

Status

Assignee

Unassigned

Reporter

ylang

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Time tracking

12h

Components

Affects versions

4.4.4.Final

Priority

Major