How to optimize Querybuilder query
I have this query -
group.p.or=true
type=cq:Page
p.limit=10
group.1_group.path=/content/path/path1
group.1_group.1_group.p.or=true
group.1_group.1_group.1_property.value=false
group.1_group.1_group.2_property=jcr:content/pageTemplateType
group.1_group.1_group.1_property=jcr:content/pageTemplateType
group.1_group.1_group.2_property.operation=unequals
group.1_group.1_group.1_property.operation=exists
group.1_group.1_group.2_property.value=template
group.1_group.path.self=true
group.2_group.path=/content/path/path-2
group.2_group.1_group.p.or=true
group.2_group.1_group.1_property.value=false
group.2_group.1_group.2_property=jcr:content/pageTemplateType
group.2_group.1_group.1_property=jcr:content/pageTemplateType
group.2_group.1_group.2_property.operation=unequals
group.2_group.1_group.1_property.operation=exists
group.2_group.1_group.2_property.value=template
group.2_group.path.self=true
What I am trying to do is that, query multiple paths and return the paths which have the property 'pageTemplateType' value not equal to 'template' or the property pageTemplateType does not exist.
This query works fine but it takes a long time more than 1 second. But if I just remove the self i.e group.2_group.path.self=true or group.1_group.path.self=true then it takes around only 0.02 second. So I do not understand how to optimize it, how to use self efficiently.
