You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Vikas Saurabh (JIRA)" <ji...@apache.org> on 2018/11/06 03:01:00 UTC

[jira] [Resolved] (OAK-7613) Taking more time for iterating row of query Result which contain Facets

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

Vikas Saurabh resolved OAK-7613.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 1.9.11
                   1.10

Fixed issue on trunk at [r1845865|https://svn.apache.org/r1845865].

There wasn't any good way to make a test, but I did an ad-hoc comparison using code at \[0] (pasted in {{FacetTest}}) to give following outputs (3 samples without fix... followed by 3 samples with fix):
{noformat}
----Without Fix----

nodes created
warm up took 4.205 s
Run up took 1.113 min


nodes created
warm up took 4.858 s
Run up took 1.156 min

nodes created
warm up took 4.433 s
Run up took 1.108 min

----With Fix-----

nodes created
warm up took 1.639 s
Run up took 13.99 s

nodes created
warm up took 1.554 s
Run up took 13.57 s

nodes created
warm up took 1.548 s
Run up took 13.65 s
{noformat}

\[0]:
{noformat}
    public void testFacetedQueryPerf() throws Exception {
        final int NUM_NODES = 1000;

        for (int i = 0; i < NUM_NODES; i++) {
            testRootNode.addNode("node" + i).setProperty("text", "foo");
        }

        superuser.save();

        System.out.println("nodes created");

        String query = "//*[@text='foo']/(rep:facet(text))";
        Query q = qm.createQuery(query, Query.XPATH);

        Stopwatch w = Stopwatch.createUnstarted();

        // Warm-up
        w.start();
        for (int i = 0; i < 5; i++) {
            QueryResult r = q.execute();
            RowIterator rows = r.getRows();
            while (rows.hasNext()) rows.nextRow();
        }
        w.stop();

        System.out.println("warm up took " + w);

        // Run-up
        w.start();
        for (int i = 0; i < 100; i++) {
            QueryResult r = q.execute();
            RowIterator rows = r.getRows();
            while (rows.hasNext()) rows.nextRow();
        }
        w.stop();

        System.out.println("Run up took " + w);
    }
{noformat}

> Taking more time for iterating row of query Result which contain Facets
> -----------------------------------------------------------------------
>
>                 Key: OAK-7613
>                 URL: https://issues.apache.org/jira/browse/OAK-7613
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene, query
>            Reporter: Ayush Garg
>            Assignee: Vikas Saurabh
>            Priority: Major
>             Fix For: 1.10, 1.9.11
>
>
> 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.   
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)