Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.1, 2.5
    • Component/s: None
    • Labels:
      None

      Description

      It seems that in the cases where the LEFT side of the join doesn't contain any hits, the QueryEngine in unable to generate an efficient query for the RIGHT side, so it basically select all the possible nodes.
      See this discussion as context [0].

      Example:
      LEFT side has hits, RIGHT side select is fast given some conditions:
      > SQL2 JOIN LEFT SIDE took 18 ms. fetched 145 rows.
      > SQL2 JOIN RIGHT SIDE took 67 ms. fetched 0 rows.

      LEFT side has no hits, RIGHT select everything
      > SQL2 JOIN LEFT SIDE took 8 ms. fetched 0 rows.
      > SQL2 JOIN RIGHT SIDE took 845 ms. fetched 13055 rows.
      ...so it fetches 130k nodes and doesn't keep any of them.

      [0] http://jackrabbit.510166.n4.nabble.com/Strange-Search-Performance-problem-with-OR-td4507121.html

      1. JCR-3280.patch
        0.8 kB
        Alex Parvulescu

        Activity

        Hide
        Alex Parvulescu added a comment -

        proposed patch.

        it seems that if the left side is empty, there is no real need to query the right side anyway.

        just for context, right join queries are rewritten to left join before running.

        Show
        Alex Parvulescu added a comment - proposed patch. it seems that if the left side is empty, there is no real need to query the right side anyway. just for context, right join queries are rewritten to left join before running.
        Hide
        Christian Stocker added a comment -

        you're my hero. the queries are now fast.
        Will report, if some issues pop up, but testsuite ran without problems

        Show
        Christian Stocker added a comment - you're my hero. the queries are now fast. Will report, if some issues pop up, but testsuite ran without problems
        Hide
        Alex Parvulescu added a comment -

        you are welcome

        fixed in revision 1306337.

        Show
        Alex Parvulescu added a comment - you are welcome fixed in revision 1306337.
        Hide
        Jukka Zitting added a comment -

        Nice! This seems important (and low-risk) enough to be included already in 2.4.1, so I merged it to the 2.4 branch in revision 1306367.

        Show
        Jukka Zitting added a comment - Nice! This seems important (and low-risk) enough to be included already in 2.4.1, so I merged it to the 2.4 branch in revision 1306367.
        Hide
        Alex Parvulescu added a comment -

        cool, thanks Jukka!

        Show
        Alex Parvulescu added a comment - cool, thanks Jukka!

          People

          • Assignee:
            Alex Parvulescu
            Reporter:
            Alex Parvulescu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development