[ 
http://jira.magnolia-cms.com/browse/MAGNOLIA-3331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=30548#action_30548
 ] 

Jörg von Frantzius commented on MAGNOLIA-3331:
----------------------------------------------

A lazy collection seems like a nice idea indeed. But AFAIK, Jackrabbit does 
some crazy default ordering of nodes in Java when no "ORDER BY" had been 
provided, already iterating over all result nodes before Magnolia does. I also 
don't see a solution to the problem of {{size()}} still doing full iteration 
without breaking API contract. 

What I had in mind originally wasn't a general performance boost for anything 
that uses query API to retrieve only a couple of objects. Our particular 
usecase that required me to subclass {{QueryResultImpl}} was to display a 
latest news teaser showing the first handful out of thousands of articles 
ordered by date.

I was mostly thinking of certain subclasses of {{AbstractListItemModel}} to 
perform sorting, filtering and shrinking via JCR query rather than in Java. 
These classes will have to be touched anyway in order to be able to work on 
thousands of nodes, next to some STKUtil method signatures needing additional 
parameters for an AND-clause and an ORDER-BY-clause. Of course the original 
method signatures would be retained.



> Provide for maxResultSize in Query-API
> --------------------------------------
>
>                 Key: MAGNOLIA-3331
>                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3331
>             Project: Magnolia
>          Issue Type: Improvement
>          Components: core
>            Reporter: Jörg von Frantzius
>            Assignee: Philipp Bärfuss
>         Attachments: magnolia-core.patch
>
>
> Currently when executing a query through the Magnolia query API, there is no 
> way of preventing the result set from being iterated completely. When e.g. 
> only the first couple of objects from a large result set are of interest, 
> then thousands of objects are instantiated unnecessarily, resulting in a huge 
> performance penalty.
> These problems have been addressed in the [openmind Magnolia Criteria 
> API|http://www.openmindlab.com/lab/products/mgnlcriteria.html], but this 
> cannot be used e.g. for the STK implementation. 
> So in order to optimize e.g. the STK, the core query API must be extended.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to