jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Parvulescu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-2959) SQL2 QueryEngine should use Lucene for sort
Date Fri, 12 Aug 2011 16:34:27 GMT

    [ https://issues.apache.org/jira/browse/JCR-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084232#comment-13084232
] 

Alex Parvulescu commented on JCR-2959:
--------------------------------------

Ok, I'm all for testing and profiling

This is with iteration included (node.getpath called on each entry)

lucene sort
select took 507 ms
fetch took 45 ms
select took 106 ms
fetch took 7 ms
select took 102 ms
fetch took 6 ms
select took 84 ms
fetch took 7 ms
select took 100 ms
fetch took 6 ms
select took 84 ms
fetch took 5 ms
select took 61 ms
fetch took 5 ms
select took 55 ms
fetch took 6 ms
select took 46 ms
fetch took 5 ms
select took 39 ms
fetch took 5 ms


  collections.sort
select took 600 ms
fetch took 43 ms
select took 104 ms
fetch took 6 ms
select took 88 ms
fetch took 7 ms
select took 92 ms
fetch took 7 ms
select took 109 ms
fetch took 5 ms
select took 90 ms
fetch took 5 ms
select took 89 ms
fetch took 6 ms
select took 89 ms
fetch took 5 ms
select took 90 ms
fetch took 5 ms
select took 98 ms
fetch took 6 ms

It still looks better.

While I agree that this solution has a different access pattern, which could be in the end
not that good, I'd like to see a test scenario that can surface the problems.
Also, this is a rough draft, so I'd like to validate (or not) the approach using more math
rather than history :)

Like you pointed out, having a native approach to sorting can allow us to improve certain
use-cases that are really poor performing in sql2 right now. Sorting at the end on the entire
result set does limit what we can do in the way of optimization and performance.


> SQL2 QueryEngine should use Lucene for sort
> -------------------------------------------
>
>                 Key: JCR-2959
>                 URL: https://issues.apache.org/jira/browse/JCR-2959
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>    Affects Versions: 2.2.1
>            Reporter: Robert Seidel
>            Priority: Minor
>         Attachments: JCR-2959.patch
>
>
> Currently all SQL2 queries with "order by" expression are sorted with Collections.sort
- which is slow and very bad if there are lots of hits. Lucene should be used for sorting
hits instead.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message