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

Array index key on scalars gives wrong results

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      The problem exist from 4.6.0 ( the way we index array index key if the value is scalar is not right). This exposed with implicit array covering.

      insert into default values ("k01",{"arr1":"hello"});
      create index ix20 on default (ALL arr1);
      select meta().id FROM default WHERE ANY v IN arr1 SATISFIES v = "hello" END;
      select meta(d).id FROM default AS d UNNEST d.arr1 AS v  WHERE  v = "hello";
      

      Above 2 queries gives one result instead of zero. If the query uses non covering index it returns correct results.

      The reason is index has Array index key ALL arr1, arr1 is scalar.
      The way we index/scan must change to fix this or disable implicit array index covering.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty