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

filter wrongly pushed on indexscan

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Morpheus
    • Morpheus
    • query
    • None
    • 1

    Description

      With 7.2.0-1106 (indexer changes)

       

      Filter on IndexScan is in correct.

       

       

      CREATE INDEX mix1 ON lkm(fname MISSING DESC, lname, team);
      cbq> EXPLAIN SELECT DISTINCT META(l).id FROM lkm AS l UNNEST l.contacts AS c WHERE c.id LIKE 'stephen.%' ;
      {
          "requestID": "68bfa55b-2b56-4f1d-b4b0-5b9b72135fa7",
          "signature": "json",
          "results": [
          {
              "plan": {
                  "#operator": "Sequence",
                  "~children": [
                      {
                          "#operator": "IndexScan3",
                          "as": "l",
                          "filter": "((`c`.`id`) like \"stephen.%\")",
                          "index": "mix1",
                          "index_id": "b9e8f6dd05822bb0",
                          "index_keys": [
                              "_index_key ((meta(`l`).`id`))"
                          ],
                          "index_projection": {
                              "primary_key": true
                          },
                          "keyspace": "lkm",
                          "namespace": "default",
                          "spans": [
                              {
                                  "range": [
                                      {
                                          "inclusion": 0,
                                          "index_key": "`fname`"
                                      }
                                  ]
                              }
                          ],
                          "using": "gsi"
                      },
                      {
                          "#operator": "Fetch",
                          "as": "l",
                          "keyspace": "lkm",
                          "namespace": "default"
                      },
                      {
                          "#operator": "Parallel",
                          "~child": {
                              "#operator": "Sequence",
                              "~children": [
                                  {
                                      "#operator": "Filter",
                                      "alias": "l",
                                      "condition": "is_array((`l`.`contacts`))"
                                  },
                                  {
                                      "#operator": "Unnest",
                                      "as": "c",
                                      "expr": "(`l`.`contacts`)",
                                      "filter": "(((`c`.`id`) like \"stephen.%\") and (`c` is not missing))"
                                  }
                              ]
                          }
                      },
                      {
                          "#operator": "Parallel",
                          "~child": {
                              "#operator": "Sequence",
                              "~children": [
                                  {
                                      "#operator": "InitialProject",
                                      "distinct": true,
                                      "result_terms": [
                                          {
                                              "expr": "(meta(`l`).`id`)"
                                          }
                                      ]
                                  },
                                  {
                                      "#operator": "Distinct"
                                  }
                              ]
                          }
                      },
                      {
                          "#operator": "Distinct"
                      }
                  ]
              },
              "text": "SELECT DISTINCT META(l).id FROM lkm AS l UNNEST l.contacts AS c WHERE c.id LIKE 'stephen.%';"
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "2.127427ms",
              "executionTime": "2.058692ms",
              "resultCount": 1,
              "resultSize": 3036,
              "serviceLoad": 2
          }
      }
      

       

      Attachments

        Issue Links

          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:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty