jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davide Giannella (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OAK-6359) Change behavior for very complex queries
Date Mon, 03 Jul 2017 11:23:00 GMT

     [ https://issues.apache.org/jira/browse/OAK-6359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Davide Giannella updated OAK-6359:
----------------------------------
    Fix Version/s:     (was: 1.7.3)
                   1.7.4

> Change behavior for very complex queries
> ----------------------------------------
>
>                 Key: OAK-6359
>                 URL: https://issues.apache.org/jira/browse/OAK-6359
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: query
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Critical
>              Labels: candidate_oak_1_2, candidate_oak_1_4, candidate_oak_1_6
>             Fix For: 1.8, 1.7.4
>
>
> Very complex queries can cause take a long time to parse, and can possibly cause OOME.
It would be good if processing queries automatically stops after some number of loops, after
some time, or some amount of memory was used. And then throw an exception "query too complex".
> Example query:
> {noformat}
> //element(*,rep:Authorizable)[ ( (  
>  jcr:like(fn:lower-case(fn:name()), 'audio%')
>  or jcr:contains(@rep:principalName,'audio*')
>  or jcr:contains(@cq:first-name,'audio*')
>  or jcr:contains(@cq:last-name,'audio*')
>  or jcr:contains(profile/@givenName,'audio*')
>  or jcr:contains(profile/@familyName,'audio*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'conference%')
>  or jcr:contains(@rep:principalName,'conference*')
>  or jcr:contains(@cq:first-name,'conference*')
>  or jcr:contains(@cq:last-name,'conference*')
>  or jcr:contains(profile/@givenName,'conference*')
>  or jcr:contains(profile/@familyName,'conference*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'details:%')
>  or jcr:contains(@rep:principalName,'details:*')
>  or jcr:contains(@cq:first-name,'details:*')
>  or jcr:contains(@cq:last-name,'details:*')
>  or jcr:contains(profile/@givenName,'details:*')
>  or jcr:contains(profile/@familyName,'details:*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'conference%')
>  or jcr:contains(@rep:principalName,'conference*')
>  or jcr:contains(@cq:first-name,'conference*')
>  or jcr:contains(@cq:last-name,'conference*')
>  or jcr:contains(profile/@givenName,'conference*')
>  or jcr:contains(profile/@familyName,'conference*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'code:%')
>  or jcr:contains(@rep:principalName,'code:*')
>  or jcr:contains(@cq:first-name,'code:*')
>  or jcr:contains(@cq:last-name,'code:*')
>  or jcr:contains(profile/@givenName,'code:*')
>  or jcr:contains(profile/@familyName,'code:*') )
>  and (  jcr:like(fn:lower-case(fn:name()), '123456%')
>  or jcr:contains(@rep:principalName,'123456*')
>  or jcr:contains(@cq:first-name,'123456*')
>  or jcr:contains(@cq:last-name,'123456*')
>  or jcr:contains(profile/@givenName,'123456*')
>  or jcr:contains(profile/@familyName,'123456*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'further%')
>  or jcr:contains(@rep:principalName,'further*')
>  or jcr:contains(@cq:first-name,'further*')
>  or jcr:contains(@cq:last-name,'further*')
>  or jcr:contains(profile/@givenName,'further*')
>  or jcr:contains(profile/@familyName,'further*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'dial%')
>  or jcr:contains(@rep:principalName,'dial*')
>  or jcr:contains(@cq:first-name,'dial*')
>  or jcr:contains(@cq:last-name,'dial*')
>  or jcr:contains(profile/@givenName,'dial*')
>  or jcr:contains(profile/@familyName,'dial*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'in%')
>  or jcr:contains(@rep:principalName,'in*')
>  or jcr:contains(@cq:first-name,'in*')
>  or jcr:contains(@cq:last-name,'in*')
>  or jcr:contains(profile/@givenName,'in*')
>  or jcr:contains(profile/@familyName,'in*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'numbers:%')
>  or jcr:contains(@rep:principalName,'numbers:*')
>  or jcr:contains(@cq:first-name,'numbers:*')
>  or jcr:contains(@cq:last-name,'numbers:*')
>  or jcr:contains(profile/@givenName,'numbers:*')
>  or jcr:contains(profile/@familyName,'numbers:*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'http://wikipedia.org%')
>  or jcr:contains(@rep:principalName,'http://wikipedia.org*')
>  or jcr:contains(@cq:first-name,'http://wikipedia.org*')
>  or jcr:contains(@cq:last-name,'http://wikipedia.org*')
>  or jcr:contains(profile/@givenName,'http://wikipedia.org*')
>  or jcr:contains(profile/@familyName,'http://wikipedia.org*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'conference%')
>  or jcr:contains(@rep:principalName,'conference*')
>  or jcr:contains(@cq:first-name,'conference*')
>  or jcr:contains(@cq:last-name,'conference*')
>  or jcr:contains(profile/@givenName,'conference*')
>  or jcr:contains(profile/@familyName,'conference*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'number(s):%')
>  or jcr:contains(@rep:principalName,'number(s):*')
>  or jcr:contains(@cq:first-name,'number(s):*')
>  or jcr:contains(@cq:last-name,'number(s):*')
>  or jcr:contains(profile/@givenName,'number(s):*')
>  or jcr:contains(profile/@familyName,'number(s):*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'emea:%')
>  or jcr:contains(@rep:principalName,'emea:*')
>  or jcr:contains(@cq:first-name,'emea:*')
>  or jcr:contains(@cq:last-name,'emea:*')
>  or jcr:contains(profile/@givenName,'emea:*')
>  or jcr:contains(profile/@familyName,'emea:*') )
>  and (  jcr:like(fn:lower-case(fn:name()), '%')
>  or jcr:contains(@rep:principalName,'*')
>  or jcr:contains(@cq:first-name,'*')
>  or jcr:contains(@cq:last-name,'*')
>  or jcr:contains(profile/@givenName,'*')
>  or jcr:contains(profile/@familyName,'*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'test%')
>  or jcr:contains(@rep:principalName,'test*')
>  or jcr:contains(@cq:first-name,'test*')
>  or jcr:contains(@cq:last-name,'test*')
>  or jcr:contains(profile/@givenName,'test*')
>  or jcr:contains(profile/@familyName,'test*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'to%')
>  or jcr:contains(@rep:principalName,'to*')
>  or jcr:contains(@cq:first-name,'to*')
>  or jcr:contains(@cq:last-name,'to*')
>  or jcr:contains(profile/@givenName,'to*')
>  or jcr:contains(profile/@familyName,'to*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'join%')
>  or jcr:contains(@rep:principalName,'join*')
>  or jcr:contains(@cq:first-name,'join*')
>  or jcr:contains(@cq:last-name,'join*')
>  or jcr:contains(profile/@givenName,'join*')
>  or jcr:contains(profile/@familyName,'join*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'the%')
>  or jcr:contains(@rep:principalName,'the*')
>  or jcr:contains(@cq:first-name,'the*')
>  or jcr:contains(@cq:last-name,'the*')
>  or jcr:contains(profile/@givenName,'the*')
>  or jcr:contains(profile/@familyName,'the*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'meeting:%')
>  or jcr:contains(@rep:principalName,'meeting:*')
>  or jcr:contains(@cq:first-name,'meeting:*')
>  or jcr:contains(@cq:last-name,'meeting:*')
>  or jcr:contains(profile/@givenName,'meeting:*')
>  or jcr:contains(profile/@familyName,'meeting:*') )
>  and (  jcr:like(fn:lower-case(fn:name()), 'http://wikipedia.org%')
>  or jcr:contains(@rep:principalName,'http://wikipedia.org*')
>  or jcr:contains(@cq:first-name,'http://wikipedia.org*')
>  or jcr:contains(@cq:last-name,'http://wikipedia.org*')
>  or jcr:contains(profile/@givenName,'http://wikipedia.org*')
>  or jcr:contains(profile/@familyName,'http://wikipedia.org*') ) ) ] 
>  order by @rep:principalName
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message