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

CoveredBy() is not working properly on nested fields with Join

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.0.0, 6.5.0
    • 5.1.0, 5.5.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      CREATE INDEX ix51 ON default(main.status);
      CREATE INDEX ix52 ON default(main.owner);
      EXPLAIN SELECT store.main.status
      FROM default store
      LEFT JOIN default item ON KEY item.main.owner FOR store
      WHERE store.main.status = "OPEN";
      

      LEFT side of query should have covered by ix51 but it is not covered. For following expression As key spaces are different it should have been coveredSkip which should be true for covering

      expression.IsCovered(expr, alias, coveringExprs) is returns false for
           expr : ((`item`.`main`).`owner`)
           alias: "store"
           coveringExprs : [((`store`.`main`).`status`), (meta(`store`).`id`)]
      

      If the fields are not nested it is covered (below example)

      CREATE INDEX ix51 ON default(status);
      CREATE INDEX ix52 ON default(owner);
      EXPLAIN SELECT store.status
      FROM default store
      LEFT JOIN default item ON KEY item.owner FOR store
      WHERE store.status = "OPEN";
      

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-30350
          # Subject Branch Project Status CR V

          Activity

            People

              ajay.bhullar Ajay Bhullar
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty