[
https://issues.apache.org/jira/browse/OAK-2056?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Davide Giannella updated OAK-2056:
----------------------------------
Attachment: OAK-2056-r1.patch
In [^OAK-2056-r1.patch] a proposal for a change in the compareTo
method. Basically I fell back to string literals in case of same time
zone that should be the most common use case.
The new numbers with the patch in place are:
{noformat}
# OrderByDate min 10% 50% 90% max N
Oak-Tar 21 21 124 3903 3903 4
# Iterations/Load 10 100 1000 5000
Time (ms) 23 21 225 3903
{noformat}
if did correctly the math we're in the range of 80-90% faster.
[~mduerig] could you please review the patch. If fine I'll commit to
trunk.
> Optimize orderings by date fields
> ---------------------------------
>
> Key: OAK-2056
> URL: https://issues.apache.org/jira/browse/OAK-2056
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: query
> Affects Versions: 1.0.4, 1.0.8
> Reporter: Przemo Pakulski
> Labels: performance
> Attachments: OAK-2056-r1.patch
>
>
> Sorting by date fields is very slow in oak, especially if result set size is
> large.
> I'm running the following JCR-SQL2 query
> {code}
> SELECT * FROM [cq:PageContent] AS [c] WHERE ISDESCENDANTNODE('/content')
> {code}
> which returns 3270 results on my oak repo.
> {noformat}
> Query execution times are as below
> ---------------------------------------
> No order clause | 0,147 sec
> ORDER BY [jcr:title] | 1,203 sec
> ORDER BY [jcr:createdBy] | 1,018 sec
> ORDER BY [jcr:created] | 25,229 sec
> {noformat}
> Ordering by date field adds extra 24 seconds overhead.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)