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

Optimize copy version

Description

Right now the procedure at a higher level:

  • copy a batch of documents in one transaction

  • for each document in that batch, copy a batch of text flows in one transaction

  • for each textflows in that batch, copy a batch of text flow targets in one transaction

We could optimize the process by fetch a batch of textflows and all of their targets in memory, and then copy them all. This way we can eliminate the number of sql generated (n+1) and make use of hibernate session cache.

We could also try to reduce the use of collection field on entity, e.g.

1 textFlow.getTargets().put(locale, target)

. The collection will be populated unnecessarily. We could've just insert the new target directly.

Status

Assignee

Patrick Huang

Reporter

Patrick Huang

Labels

Tested Version/s

None

Sprint

None

Priority

unspecified