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

Filter operator applied twice for adhoc query parameters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Critical
    • 7.0.0
    • Cheshire-Cat
    • query
    • None
    • Untriaged
    • 1
    • Yes

    Description

      Rerpo:
      CREATE INDEX ix1 ON default(a);
      \set -$a = 1;
      EXPLAIN SELECT * FROM default WHERE a = $a;

      "~children": [
                                  {
                                      "#operator": "Filter",
                                      "condition": "((`default`.`a`) = 1)"
                                  },
                                  {
                                      "#operator": "Filter",
                                      "condition": "((`default`.`a`) = $a)"
                                  },
      
      

      {
          "requestID": "d8139696-5569-48fe-b827-36266d381619",
          "signature": "json",
          "results": [
          {
              "plan": {
                  "#operator": "Sequence",
                  "~children": [
                      {
                          "#operator": "IndexScan3",
                          "index": "ix1",
                          "index_id": "9e2eceb58ecd3698",
                          "index_projection": {
                              "primary_key": true
                          },
                          "keyspace": "default",
                          "namespace": "default",
                          "spans": [
                              {
                                  "exact": true,
                                  "range": [
                                      {
                                          "high": "1",
                                          "inclusion": 3,
                                          "low": "1"
                                      }
                                  ]
                              }
                          ],
                          "using": "gsi"
                      },
                      {
                          "#operator": "Fetch",
                          "keyspace": "default",
                          "namespace": "default"
                      },
                      {
                          "#operator": "Parallel",
                          "~child": {
                              "#operator": "Sequence",
                              "~children": [
                                  {
                                      "#operator": "Filter",
                                      "condition": "((`default`.`a`) = 1)"
                                  },
                                  {
                                      "#operator": "Filter",
                                      "condition": "((`default`.`a`) = $a)"
                                  },
                                  {
                                      "#operator": "InitialProject",
                                      "result_terms": [
                                          {
                                              "expr": "self",
                                              "star": true
                                          }
                                      ]
                                  }
                              ]
                          }
                      }
                  ]
              },
              "text": "select * FROM default where a = $a;"
          }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "891.083µs",
              "executionTime": "819.644µs",
              "resultCount": 1,
              "resultSize": 2182,
              "serviceLoad": 2
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              mihir.kamdar Mihir Kamdar (Inactive)
              Sitaram.Vemulapalli Sitaram Vemulapalli
              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