Let me explain with example
xpath query 1 ="//element(, nt:unstructured)[ (jcr:contains(., 'admin')) ]"
xpath query 2="//element(, nt:unstructured)[(jcr:contains(., 'admin')) ] /(rep:facet(jcr:title))"
I want to extract result on above constrain and facet on property jcr:title .
Case 1: First execute query 1 and iterate rows of QueryResult for getting ResultSet and then execute query 2 then extract facet using FacetResult class.
Case 2:Execute only query 2 and then iterate rows of QueryResult for getting ResultSet and extract facet using FacetResult class. In this case time taken should be less as compared to case 1 because in case only query is executed. but case 2 is taking more time.
In case 2 QueryResult ( getting on executing query 2)also contain facet Result and for iterating rows it is taking very large time compared to case 1.
Possible reason for this is that during iterating each row it also iterate columns(that contain facetResult) so as size of facetResult increases time for iterating row also increases.