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

limit is wrongly pushed to IntersectScan

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.6.2
    • 4.6.2
    • query
    • None
    • Untriaged
    • Yes

    Description

      create index idx_abv on default(abv); 
      create index idx_name on default(name);
       
      explain select * from default where name = "abc"  and age = 10 and    abv > 0  limit 10;
      {
          "requestID": "5eae0544-349e-4a97-92c4-d5f845f6d544",
          "signature": "json",
          "results": [
              {
                  "plan": {
                      "#operator": "Sequence",
                      "~children": [
                          {
                              "#operator": "Sequence",
                              "~children": [
                                  {
                                      "#operator": "IntersectScan",
                                      "limit": "10",
                                      "scans": [
                                          {
                                              "#operator": "IndexScan",
                                              "index": "idx_abv",
                                              "index_id": "d4809b99d0a02b50",
                                              "keyspace": "default",
                                              "namespace": "default",
                                              "spans": [
                                                  {
                                                      "Exact": true,
                                                      "Range": {
                                                          "Inclusion": 0,
                                                          "Low": [
                                                              "0"
                                                          ]
                                                      }
                                                  }
                                              ],
                                              "using": "gsi"
                                          },
                                          {
                                              "#operator": "IndexScan",
                                              "index": "idx_name",
                                              "index_id": "e0c424444a603d04",
                                              "keyspace": "default",
                                              "namespace": "default",
                                              "spans": [
                                                  {
                                                      "Exact": true,
                                                      "Range": {
                                                          "High": [
                                                              "\"abc\""
                                                          ],
                                                          "Inclusion": 3,
                                                          "Low": [
                                                              "\"abc\""
                                                          ]
                                                      }
                                                  }
                                              ],
                                              "using": "gsi"
                                          }
                                      ]
                                  },
                                  {
                                      "#operator": "Fetch",
                                      "keyspace": "default",
                                      "namespace": "default"
                                  },
                                  {
                                      "#operator": "Parallel",
                                      "~child": {
                                          "#operator": "Sequence",
                                          "~children": [
                                              {
                                                  "#operator": "Filter",
                                                  "condition": "((((`default`.`name`) = \"abc\") and ((`default`.`age`) = 10)) and (0 < (`default`.`abv`)))"
                                              },
                                              {
                                                  "#operator": "InitialProject",
                                                  "result_terms": [
                                                      {
                                                          "expr": "self",
                                                          "star": true
                                                      }
                                                  ]
                                              },
                                              {
                                                  "#operator": "FinalProject"
                                              }
                                          ]
                                      }
                                  }
                              ]
                          },
                          {
                              "#operator": "Limit",
                              "expr": "10"
                          }
                      ]
                  },
                  "text": "select * from default where name = \"abc\"  and age = 10 and    abv > 0  limit 10;"
              }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "2.725217ms",
              "executionTime": "2.708112ms",
              "resultCount": 1,
              "resultSize": 4611
          }
      }
      
      

      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)
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty