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

Add column for explained "statement" to "explain" Query result, next to 'plan' column.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.12.0, 1.8.12, 1.10.2
    • 1.18.0
    • query
    • None
    • Patch

    Description

      The "explain" behavior of the core Query is very useful for helping to debug JCR query execution planning. For xpath queries, the resulting "plan" column refers to the result of running XPathToSQL2Converter to produce a JCR-SQL2 statement for execution. This SQL2 statement should be exposed through the same API as the "plan", by way of an additional column named "statement" in the single result row. 

      At this time, this underlying SQL2 statement is inaccessible to users of the JCR Query interface, which can only provide the original XPath statement.

      To access the converted SQL2 statement, a class targeting the JCR API must implement a regular expression match against a log stream retrieved via slf4j MDC.

      This facility is not very portable, and an effective pattern on one version of Oak may not be effective on a different version of Oak, for any number of reasons.

      Also, the XPathToSQL2Converter package is not exported in an OSGi environment, so client code cannot use that API to reconstruct the SQL2 statement in parallel.

      Attachments

        Activity

          People

            thomasm Thomas Mueller
            madamcin Mark Adamcin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: