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

correlated subquery with covered index will not return results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 4.6.0, 5.0.0
    • 4.5.1, 4.6.0, 5.0.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      create primary index on default;
      create index ix1 on default(x);
      insert into default values("kk02", {"x":100, "y":101, "z":102});
      select d.x,d.y from default d where x IN (select raw d.x from default b use keys["kk02"]);
      -- above query is not covered and return right results
      select d.x from default d where x IN (select raw d.x from default b use keys["kk02"]);
      -- above parent query is covered with index ix1 and will return no results.
      ............                       
          "~children": [
                                      {
                                          "#operator": "Filter",
                                          "condition": "(cover ((`d`.`x`)) in (select raw (`d`.`x`) from `default` as `b` use keys [\"kk02\"]))"
                                      },
      ..........
      

      cover is missing in the snippet of subquery.

      Attachments

        Issue Links

          Activity

            People

              Prerna.Manaktala Prerna Manaktala (Inactive)
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty