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

Adaptive index with JOIN generates wrong spans

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.5.0
    • 4.6.4, 5.1.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      This works fine in vulcan

      create index ixd on default(DISTINCT PAIRS(self));
      explain SELECT s.* FROM default c JOIN default s ON KEYS c.run_name WHERE s.chain = "BCRh" limit 1;
      

                             "~children": [
                                  {
                                      "#operator": "DistinctScan",
                                      "scan": {
                                          "#operator": "IndexScan",
                                          "index": "ixd",
                                          "index_id": "a4a35b29583fa53c",
                                          "keyspace": "default",
                                          "namespace": "default",
                                          "spans": [
                                              {
                                                  "Exact": true,
                                                  "Range": {
                                                      "High": [
                                                          "[\"chain\", \"BCRh\"]"
                                                      ],
                                                      "Inclusion": 3,
                                                      "Low": [
                                                          "[\"chain\", \"BCRh\"]"
                                                      ]
                                                  }
                                              }
                                          ],
                                          "using": "gsi"
                                      }
                                  }
      
      

      The above query should not have selected index ixd and because no predicate on d.
      This works fine in vulcan

      Attachments

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

        Activity

          People

            ajay.bhullar Ajay Bhullar
            Sitaram.Vemulapalli Sitaram Vemulapalli
            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