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

[N1QL] count(distinct field) gives different results for in operator with secondary index vs primary index

    XMLWordPrintable

Details

    • Untriaged
    • Yes

    Description

      Test which fails:
      ./testrunner -i query2.ini -p doc-per-day=6 -t tuqquery.tuq_2i_index.QueriesIndexs.test_count_distinct

      Query executed:
      select count(distinct VMs[1].os) from default where VMs[1].os='windows' and tasks_points.task1 in [1,2,3]

      Indexes present:
      CREATE INDEX `idx` ON `default`(`job_title`) WHERE (`email` like "%@%.%")
      CREATE INDEX `idx2` ON `default`(((`VMs`[1]).`os`),(`tasks_points`.`task1`))
      CREATE INDEX `idx3` ON `default`(((`VMs`[1]).`os`),`name`) WHERE ((`tasks_points`.`task1`) = 1)

      Result for query with secondary index:
      [

      { "$1": 3 }

      ]
      Result for query with primary index:
      [

      { "$1": 1 }

      ]

      Prathibha Bisarahalli:This seems to be related to MB-24284 though test in MB-24284 passes hence MB-24284 is verified as fixed.

      Attaching dataset.

      Attachments

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

        Activity

          People

            prathibha Prathibha Bisarahalli (Inactive)
            Prerna.Manaktala Prerna Manaktala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty