jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-1263) optimize oak index to support 'fast ORDER BY' queries to support sorting & pagination for large set of children
Date Wed, 05 Mar 2014 09:06:42 GMT

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

Thomas Mueller commented on OAK-1263:
-------------------------------------

Hi,

The new patch (OAK-1263-r1b.patch) unfortunately still has similar problems than the old one.
If you look at the patch, the very first lines are:

{noformat}
-    public static NodeBuilder getOrCreateOakIndex(NodeBuilder root) {
-        NodeBuilder index;
-        if (!root.hasChildNode(INDEX_DEFINITIONS_NAME)) {
-            index = root.child(INDEX_DEFINITIONS_NAME);
-            // TODO: use property node type name
-            index.setProperty(JCR_PRIMARYTYPE, NT_UNSTRUCTURED, NAME);
-        } else {
-            index = root.child(INDEX_DEFINITIONS_NAME);
-        }
-        return index;
-    }
+   public static NodeBuilder getOrCreateOakIndex(NodeBuilder root) {
+      NodeBuilder index;
+      if (!root.hasChildNode(INDEX_DEFINITIONS_NAME)) {
+         index = root.child(INDEX_DEFINITIONS_NAME);
+         // TODO: use property node type name
+         index.setProperty(JCR_PRIMARYTYPE, NT_UNSTRUCTURED, NAME);
+      } else {
+         index = root.child(INDEX_DEFINITIONS_NAME);
+      }
+      return index;
+   }
{noformat}

This is a formatting change that is unneeded (and actually bad, because its 3 spaces of indentation
instead of 4).

> the headers where already there

The classes where the license files are missing are new...

> as in the use case you highlighted it's a constant (final) and by java conventions it
should be uppercase. 

Constants are class level, and "static final". Variables are method level. It is common practise
to use lowercase for variable names, no matter if the value is changed or not later on. For
example, in Scala, there are "var" and "val", but still, the identifier names are lowercase.

> optimize oak index to support 'fast ORDER BY' queries to support sorting & pagination
for large set of children
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: OAK-1263
>                 URL: https://issues.apache.org/jira/browse/OAK-1263
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: query
>    Affects Versions: 0.12
>            Reporter: Stefan Egli
>            Assignee: Alex Parvulescu
>             Fix For: 0.18
>
>         Attachments: OAK-1263-r1.patch, OAK-1263-r1a.patch, OAK-1263-r1b.patch, benchmark-20140228112150.log,
benchmark-20140228120718.log, benchmark-20140228125248.log
>
>
> We have a use case where we'd like to be able to use an index in a "pagination-like"
fashion. That is, we'd like to be able to have an index on a subtree on a certain property,
and then run a query which does ORDER BY that property combined with OFFSET. That way, essentially
allowing pagination of child nodes of a particular parent based on 'sorted by a certain property'.
> AFAIU currently the oak index is not optimized to support ORDER BY queries in a fast
manner. The index keeps 'the child nodes unsorted', ie to process an ORDER BY, the child nodes
would have to be 'manually sorted' which can result in bad performance given a large number
of child nodes.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message