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-5937) Disable query where path restriction is not absolute
Date Wed, 15 Mar 2017 14:21:41 GMT

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

Thomas Mueller commented on OAK-5937:
-------------------------------------

Why is it a problem?

The traversal limit should already prevent such queries from consuming too much resources.
And if that's not good enough, there is the option to reject queries that have no index (where
traversal is the only option).

If there is no index, then yes this query is slow (if there are many nodes), as it uses traversal.
But if there is an index on the node name, then the plan is:

{noformat}
[nt:base] as [a] /* lucene:testNodeName(/oak:index/testNodeName) :nodeName:content where name([a])
= 'content' */ 
inner join [nt:base] as [b] /* lucene:testNodeName(/oak:index/testNodeName) :nodeName:foo
where name([b]) = 'foo' */ on ischildnode([b], [a]) 
inner join [nt:base] as [c] /* lucene:testNodeName(/oak:index/testNodeName) :nodeName:bar
where name([c]) = 'bar' */ on ischildnode([c], [b])
{noformat}

> Disable query where path restriction is not absolute
> ----------------------------------------------------
>
>                 Key: OAK-5937
>                 URL: https://issues.apache.org/jira/browse/OAK-5937
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: query
>            Reporter: Chetan Mehrotra
>            Priority: Minor
>             Fix For: 1.8
>
>
> Query like below cannot be executed in a performant way. We should provide an option
to reject such queries
> //content/foo/bar



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message