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

When query with OR is divided into union of queries, options (like index tag) are not passed into subqueries.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.10.2, 1.8.17
    • 1.14.0, 1.8.18, 1.10.6
    • core
    • None

    Description

      When query with OR is divided into union of queries, options (like index tag) are not passed into subqueries - in effect alternative query  sometimes f.e. uses indexes it shouldn't use.

       

      org.apache.jackrabbit.oak.query.QueryImpl.buildAlternativeQuery()
      
      org.apache.jackrabbit.oak.query.QueryImpl.copyOf()
      
       
      
      2019-03-21 16:32:25,600 DEBUG [org.apache.jackrabbit.oak.query.QueryEngineImpl] (default task-1) Parsing JCR-SQL2 statement: select distinct d.* from [crkid:document] as d where ([d].[metadane/inneMetadane/*/wartosc] = 'AX' and [d].[metadane/inneMetadane/*/klucz] = 'InnyKod') or ([d].[metadane/inneMetadane/*/wartosc] = 'AB' and [d].[metadane/inneMetadane/*/klucz] = 'InnyKod') option(index tag crkid_dokument_month_2019_3)
      
      
      2019-03-21 16:32:25,607 DEBUG [org.apache.jackrabbit.oak.query.QueryImpl] (default task-1) cost using filter Filter(query=select distinct d.* from [crkid:document] as d where ([d].[metadane/inneMetadane/*/wartosc] = 'AB') and ([d].[metadane/inneMetadane/*/klucz] = 'InnyKod'), path=*, property=[metadane/inneMetadane/*/klucz=[InnyKod], metadane/inneMetadane/*/wartosc=[AB]])
       

      Attachments

        Activity

          People

            thomasm Thomas Mueller
            piotr_tajdus Piotr Tajduś
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: