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

[BP to 7.1.5/7.2.1 MB-56562] - Covering FLATTEN_KEYS() may generate wrong results

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      Found by Bingjie Miao 

      CREATE INDEX ix20 ON default (DISTINCT ARRAY FLATTEN_KEYS(v) FOR v IN a1 END);
      UPSERT INTO default VALUES("k01", {"c1":10, "a1": [1,2,3]});
      SELECT META(d).id
      FROM default d
      WHERE ANY v IN a1 SATISFIES abs(v) = 3 END;
      

      Due to false positives and Distinct scan rows eliminated

      We should apply filter on indexScan or disable covering

      Issue Resolution
      Covering FLATTEN_KEYS() on an array index generated incorrect results. This was because a modified version of the ANY clause was applied after the index which meant false positives were retained and Distinct scan rows were eliminated. The ANY filter is now applied on an index scan itself when covering an index scan with flatten keys.

      Attachments

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

        Activity

          People

            ajay.bhullar Ajay Bhullar
            bingjie.miao Bingjie Miao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty