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] [Comment Edited] (OAK-1744) GQL queries with "jcr:primaryType='x'" don't use the node type index
Date Thu, 28 Jan 2016 14:49:39 GMT

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

Thomas Mueller edited comment on OAK-1744 at 1/28/16 2:49 PM:
--------------------------------------------------------------

A similar issue is when using multiple node type:

{noformat}
/jcr:root/content//*[jcr:contains(., 'abc') and 
(((@jcr:primaryType = 'page')) or ((@jcr:primaryType = 'asset'))) ]
{noformat}

It would be good if this is converted to a union of the form:

{noformat}
select *
  from [page] as a
  where isdescendantnode(a, '/content')
  and contains(*, 'abc')
  and [jcr:primaryType] = 'page'
  union select *
  from [asset] as a
  where isdescendantnode(a, '/content')
  and contains(*, 'abc')
  and [jcr:primaryType] = 'asset'
{noformat}

This would use two indexes, one for assets and one for pages. [~chetanm], do you think this
would be a good change, or do you see any problem with this?


was (Author: tmueller):
A similar issue is when using multiple node type:

{noformat}
/jcr:root/content//*[jcr:contains(., 'abc') and (((@jcr:primaryType = 'page')) or ((@jcr:primaryType
= 'asset'))) ]
{noformat}

It would be good if this is converted to a union of the form:

{noformat}
select *
  from [page] as a
  where isdescendantnode(a, '/content')
  and contains(*, 'abc')
  and [jcr:primaryType] = 'page'
  union select *
  from [asset] as a
  where isdescendantnode(a, '/content')
  and contains(*, 'abc')
  and [jcr:primaryType] = 'asset'
{noformat}

> GQL queries with "jcr:primaryType='x'" don't use the node type index
> --------------------------------------------------------------------
>
>                 Key: OAK-1744
>                 URL: https://issues.apache.org/jira/browse/OAK-1744
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: query
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 1.3.15
>
>
> GQL queries (org.apache.jackrabbit.commons.query.GQL) with type restrictions are converted
to the XPath condition "jcr:primaryType = 'x'". This conditions is not currently interpreted
as a regular node type restriction in the query engine or the node type index, as one would
expect. 
> Such restrictions could still be processed efficiently using the property index on "jcr:primaryType",
but if that one is disabled (by setting the cost manually very high, as it is done now), then
such queries don't use the expected index.
> I'm not sure yet where this should be best fixed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message