Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-1389

Query: an index is used even where traversing is faster

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.17
    • Component/s: query
    • Labels:
      None

      Description

      Currently, for queries that can use an index, the index is always preferred over traversing over the nodes. For joins, sometimes is much faster to traverse, specially the exact path is known. Example:

      /jcr:root/testroot/node[@jcr:uuid]
      

      This query will use the index on "jcr:uuid", and traverse over all nodes with the property "jcr:uuid", even thought in fact only one node would need to be read when using the TraversingIndex.

      The problems are: Currently, the TraversingIndex is not even asked to estimate the cost. Also, the cost estimation of the TraversingIndex is incorrect for such cases.

      We will also need to verify and fix the cost estimation of the other indexes (for example the PropertyIndex) conforms the QueryIndex API (getCost is supposed to return the estimated number of entries to traverse).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thomasm Thomas Mueller
                Reporter:
                thomasm Thomas Mueller
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: