jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mueller <muel...@adobe.com>
Subject Re: [Oak] Explain query command explanation
Date Wed, 04 Jun 2014 06:53:58 GMT

I will try... You will find examples in the test file "sql2_index.txt" in
the source code.

The plan contains the indexes that are used (one index per selector). The
index implementation itself decides what format to use. The format is not
yet stable; once we see more or different information is needed, the
format will be changed.

>*Property*; denoted by "/* property" - This means the query will execute
>against a property or ordered index.

The index that is in use is in the comment. The orderd index should use
"/* ordered ... */", not "/* property ... */". I'm not sure if that's
already the case.

>Example: [nt:unstructured] as [a] /* property jcr:title where
>([a].[jcr:content/jcr:title] is not null) and (isdescendantnode([a],
>[/content])) */

In this case it's using the property index on the property "jcr:title".

>Example: [nt:unstructured] as [a] /* traverse jcr:title where
>([a].[jcr:content/jcr:title] is not null) and (isdescendantnode([a],
>[/content])) */

This example is incorrect. A real-world example are:

    explain select * from [nt:base] where [jcr:uuid]=1 or [b]=2

    [nt:base] as [nt:base] /* traverse "*" */

So, the conditions are not used here. It's traversing all nodes.

    explain select b.[jcr:uuid] from [nt:base] as a
      inner join [nt:base] as b on isdescendantnode(b, a)
      where (a.[jcr:uuid] = '1' or a.[jcr:uuid] = '2')

    [nt:base] as [a] /* property jcr:uuid
      where ([a].[jcr:uuid] is not null)
      and ([a].[jcr:uuid] in(cast('1' as string), cast('2' as string))) */
      inner join [nt:base] as [b] /* traverse "* && //path/from/join//*" */
      on isdescendantnode([b], [a])

Here, the selector "a" uses a property index on "jcr:uuid". The selector
"b" uses traversal, where the path is the one from selector "a".

>*Filter*; denoted by "/* Filter(" - Not sure what this means...

The filter is the list of conditions used by an index. I think it
shouldn't be included in the query plan - is it? If yes, probably we
should change the format as it is very verbose (it includes the query).


View raw message