juliocamarero/liferay-portal — pull request #3063 by achaparro (2014-10-13 16:17:58+00:00)
Title: LPS-50579 Low performance for saving an structure if it's related to a huge number of contents with several versions

Hi @juliocamarero, @ealonso,

See https://issues.liferay.com/browse/LPS-50579 for more information.

Thanks.

PS: @ealonso, I haven't implemented a new finder method which returns just one version for every article using the structure for two main reasons:
- Queries like this:
SELECT * FROM JournalArticle WHERE structureId = X GROUP BY ArticleId
aren't valid tough MYSQL can process them (Oracle doesn't for example) since SelectItems in the SelectExpression with a GROUP BY clause must contain only aggregates or grouping columns.

- We would continue indexing unnecesary versions since we would get all the versions for every article altough just a few ones were related to the structure.