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

Chetan Mehrotra edited comment on OAK-4637 at 5/2/17 8:49 AM:
--------------------------------------------------------------

The usecase I have in mind is the one related to slingResourceType. In Sling 
the "sling:resourceType" property is added to each node created via Sling api. 
Due to this even the nodes created for Sling Job Management also have 
sling:resourceType=slingevent:Job or sling:Folder causing such nodes to be 
indexed. 

However no code does a query for these values. So we need a way to exclude such 
resource type values from getting indexed i.e. way to provide a list of values 
which should not be indexed

Also note that there may be query like below which should still be able to use 
the index on sling:resourceType. 

{noformat}
/jcr:root/etc/replication//*[jcr:like(@sling:resourceType, 
"cq/replication/components/%agent")]
{noformat}

>From my current understanding of code in property index such queries gets 
>converted to property != null (untill OAK-5897 is implemented). The current 
>implementation (rev 1793097) looks like would opt out of handling such a 
>query. But we need a way such that index still gets used for these queries. 
{noformat}
                    if (valuePattern.matchesAll()) {
                        // matches all values: not a problem
                    } else if (values == null) {
                        // "is not null" condition, but we have a value pattern
                        // that doesn't match everything
                        // so we can't use that index
                        continue;
                    }
{noformat}


was (Author: chetanm):
The usecase I have in mind is the one related to slingResourceType. In Sling 
the "sling:resourceType" property is added to each node created via Sling api. 
Due to this even the nodes created for Sling Job Management also have 
sling:resourceType=slingevent:Job or sling:Folder causing such nodes to be 
indexed. 

However no code does a query for these values. So we need a way to exclude such 
resource type values from getting indexed. 

Do note that there may be query like below which should still be able to use 
the index on sling:resourceType. 

{noformat}
/jcr:root/etc/replication//*[jcr:like(@sling:resourceType, 
"cq/replication/components/%agent")]
{noformat}

>From my current understanding of code in property index such queries gets 
>converted to property != null (untill OAK-5897 is implemented). The current 
>implementation (rev 1793097) looks like would opt out of handling such a 
>query. But we need a way such that index still gets used. 
{noformat}
                    if (valuePattern.matchesAll()) {
                        // matches all values: not a problem
                    } else if (values == null) {
                        // "is not null" condition, but we have a value pattern
                        // that doesn't match everything
                        // so we can't use that index
                        continue;
                    }
{noformat}

> Property index: include/exclude key pattern list
> ------------------------------------------------
>
>                 Key: OAK-4637
>                 URL: https://issues.apache.org/jira/browse/OAK-4637
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: property-index
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Critical
>             Fix For: 1.8
>
>
> In some cases, property indexes contain many nodes, and updating them can be 
> slow. Right now we have filters for node and mixin types, path (include and 
> exclude). 
> An include and exclude list of values (patterns) would be useful. For example 
> the property "status", if we only ever run queries with the condition "status 
> = 'ACTIVE'", then nodes with status INACTIVE and DONE don't need to be 
> indexed.



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

Reply via email to