You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2012/12/17 11:24:12 UTC
[jira] [Created] (OAK-530) Optimization for xpath queries of type
"/jcr:root//*[x/@y]"
Thomas Mueller created OAK-530:
----------------------------------
Summary: Optimization for xpath queries of type "/jcr:root//*[x/@y]"
Key: OAK-530
URL: https://issues.apache.org/jira/browse/OAK-530
Project: Jackrabbit Oak
Issue Type: Bug
Components: query
Reporter: Thomas Mueller
Assignee: Thomas Mueller
Currently, the xpath query {{/jcr:root//*[x/@y]}} is converted to:
{code}
select [jcr:path], [jcr:score], * from [nt:base] as a
where [x/y] is not null
and isdescendantnode(a, '/')
{code}
This works well (the query is executed and returns the correct result as far as I understand), but currently no index is used, even if there is an index for the property {{y}}.
To speed up executing such queries, we could
(a) change the converter to convert to a different SQL-2 query so that an index is used, or
(b) implement a special 'virtual' index that internally uses a property index, and then returns the parent nodes instead of the node that contain the property.
Currently, I think (b) is simpler, so I will try that.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira