Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2290

Indexes are not used when constraint includes bind variable or aliased property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 4.0.0.Beta2, 4.0.0.Final
    • 4.0.0.Beta1
    • JCR, Query
    • None

    Description

      None of the following queries uses (or even considers) an index, despite there being an index that is a perfect match (e.g., on nt:unstructured with column "someProperty(STRING)"):

      SELECT table.* FROM [nt:unstructured] AS table WHERE table.someProperty = $value
      SELECT table.* FROM [nt:unstructured] AS table WHERE table.someProperty = 'literal'
      SELECT * FROM [nt:unstructured] WHERE someProperty = $value
      

      Interestingly, the following query does use the index:

      SELECT * FROM [nt:unstructured] WHERE someProperty = 'literal'
      

      So there appears to be a problem with properties on aliases and use of bind variables in constraints.

      Attachments

        Activity

          People

            rhauch Randall Hauch (Inactive)
            rhauch Randall Hauch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: