Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-30970

Unnest scan does not choose union scan when unnest predicate has OR clause

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.0.0, 6.5.0
    • 5.5.0, 5.5.1, 6.0.0, 6.5.0
    • query
    • None
    • Untriaged
    • Yes

    Description

      See CBSE-5634.

      When a query has unnest, and unnest predicates has an OR clause with subterms corresponds to different indexes, in spock the planner uses an union scan, but in vulcan a primary scan is used.

      Here is a simplified repro:

      CREATE INDEX iax1 ON default(DISTINCT ARRAY v.x FOR v IN a1 END);
      CREATE INDEX iax2 ON default(DISTINCT ARRAY v.y FOR v IN a1 END);
      SELECT 1 AS a FROM default AS d UNNEST d.a1 AS v WHERE v.x = 10 OR v.y = 20;

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              korrigan.clark Korrigan Clark (Inactive)
              bingjie.miao Bingjie Miao
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  PagerDuty