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] [Updated] (JCR-2959) SQL2 QueryEngine should use Lucene for sort
Date Fri, 12 Aug 2011 15:09:27 GMT

     [ https://issues.apache.org/jira/browse/JCR-2959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alex Parvulescu updated JCR-2959:
---------------------------------

    Attachment: JCR-2959.patch

watch out, big patch coming through!

A first stab at a more integrated approach to sort. It doesn't cover all the bases yet, but
it should be enough to get us started.

Just to increase your interest, I've attached a perf test (SQL2OrderByTest#testBig), there
are the first results I see:

Old style (10 iterations)
ran select, took 941 ms
ran select, took 310 ms
ran select, took 199 ms
ran select, took 102 ms
ran select, took 112 ms
ran select, took 734 ms
ran select, took 189 ms
ran select, took 104 ms
ran select, took 105 ms
ran select, took 125 ms

New style (10 iterations)
ran select, took 629 ms
ran select, took 134 ms
ran select, took 117 ms
ran select, took 117 ms
ran select, took 133 ms
ran select, took 618 ms
ran select, took 108 ms
ran select, took 94 ms
ran select, took 84 ms
ran select, took 80 ms

It looks a bit interesting ~30% faster run times.

You can switch between implementations via a global flag (I know it's not nice): 
QueryEngine.NATIVE_SORT true for lucene native, false for Collections.sort.

It doesn't know how to sort joins yet, just simple queries.
Also, it could do better (like falling back on lucene native properties when they are available
in the index instead of loading the entire node).

Feedback very welcome!




> 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