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

N1QL: Incorrect results for queries using intersect scan as compared to same query using primary index

    XMLWordPrintable

Details

    • Untriaged
    • Yes

    Description

      This is a  regression from 4.6

      {noformat}

      Test run:

      python testrunner.py -i query3.ini -c conf/tuq/py-tuq-index.conf -p doc-per-day=1 -p reload_data=True -p nodes_init=3

       

      Use a 3 node cluster.Example query3.ini:

      global]

      port:8091

      username:root

      password:couchbase

       

      [servers]

      1:vm1

      2:vm2

      3:vm3

       

       

      [vm1]

      ip:172.23.121.127

      services:kv,index,n1ql

       

       

      [vm2]

      ip:172.23.122.194

      services:kv,index,n1ql

       

      [vm3]

      ip:172.23.105.173

      services:kv,index,n1ql

       

      [membase]

      rest_username:Administrator

      rest_password:password

      [tuq_client]

      goroot:/root/n1ql/go

      gopath:/root/n1ql/gocode

       

      This test creates indexes and uses intersect scan for few queries and compares the results to desired results.

      Example query:

      SELECT skills, VMs FROM default WHERE skills is not null AND VMs is not missing

       

      Explain plan:

      "plan": {
      "#operator": "Sequence",
      "~children": [
      {
      "#operator": "IntersectScan",
      "scans": [
      {
      "#operator": "IndexScan",
      "index": "inter_index_1146VMs",
      "index_id": "673c54d63c1c51c1",
      "keyspace": "default",
      "namespace": "default",
      "spans": [
      {
      "Range": {
      "Inclusion": 1,
      "Low": [
      "null"
      ]
      }
      }
      ],
      "using": "gsi"
      },
      {
      "#operator": "IndexScan",
      "index": "inter_index_1146skills",
      "index_id": "37ea861e2051a8bf",
      "keyspace": "default",
      "namespace": "default",
      "spans": [
      {
      "Range": {
      "Inclusion": 0,
      "Low": [
      "null"
      ]
      }
      }
      ],
      "using": "gsi"
      }
      ]
      },
      {
      "#operator": "Fetch",
      "keyspace": "default",
      "namespace": "default"
      },
      {
      "#operator": "Parallel",
      "~child": {
      "#operator": "Sequence",
      "~children": [
      {
      "#operator": "Filter",
      "condition": "(((`default`.`skills`) is not null) and ((`default`.`VMs`) is not missing))"
      },
      {
      "#operator": "InitialProject",
      "result_terms": [
      {
      "expr": "(`default`.`skills`)"
      },
      {
      "expr": "(`default`.`VMs`)"
      }
      ]
      },
      {
      "#operator": "FinalProject"
      }
      ]
      }
      }
      ]

       

      The results of above query does not match with the results from same query using primary index.Uploading dataset also.

      {noformat}

       

      Attachments

        Issue Links

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

          Activity

            People

              Prerna.Manaktala Prerna Manaktala (Inactive)
              Prerna.Manaktala Prerna Manaktala (Inactive)
              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