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

[BP MB-39684] Intersect Scan under inner of nested-loop join may produce wrong results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.6.1
    • 6.5.1
    • query
    • Security Level: Public
    • Untriaged
    • Centos 64-bit
    • 1
    • Unknown

    Description

      Untar the attachments, use following command to load data into two buckets KS1 and KS2:

      cbdocloader -c couchbase://127.0.0.1 -u Administrator -p password -m 100 -b KS1 -d ./KS1json
      cbdocloader -c couchbase://127.0.0.1 -u Administrator -p password  -m 100 -b KS2 -d ./KS2json
      

      Then create the following indexes:

      create index rand_idx_KS1 on KS1(rand_i);
      create index uniq_idx_KS2 on KS2(uniq_i);
      create index zipf_idx_KS2 on KS2(zipf_i);
      

      Then run the following query in a loop:

      select count(y.zipf_i) from KS1 x USE INDEX(rand_idx_KS1) join KS2 y on x.rand_i <= 16384 and x.uniq_i = y.uniq_i;
      

      The query should return a count of 1000, however when run repeatedly, it sometimes produces a count that's less than 1000 (early termination). The query uses intersect scan on KS2 (or y) under nested-loop join.

      Attachments

        1. KS1.tar
          1.47 MB
        2. KS2.tar
          2.93 MB

        Issue Links

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

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              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