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

Fails to generate covering scan when indexing keyspace self.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Resolved
    • Major
    • feature-backlog
    • 6.5.0
    • query
    • Untriaged
    • Unknown

    Description

      The underlying issue may be in identifier.go -> CoveredBy():
      identifier `a` is a keyspace alias and equal to keyspace, so the function returns "CoveredFalse".

      create index self1 on shellTest(self)
      explain select count(*) from shellTest AS a where a > 10
      [
       {
       "plan": {
       "#operator": "Sequence",
       "~children": [
       {
       "#operator": "IndexScan3",
       "as": "a",
       "index": "self1",
       "index_id": "205b3716ff31afc0",
       "index_projection": {
       "primary_key": true
       },
       "keyspace": "shellTest",
       "namespace": "default",
       "spans": [
       {
       "exact": true,
       "range": [
       {
       "inclusion": 0,
       "low": "10"
       }
       ]
       }
       ],
       "using": "gsi"
       },
       {
       "#operator": "Fetch",
       "as": "a",
       "keyspace": "shellTest",
       "namespace": "default"
       },
       {
       "#operator": "Parallel",
       "~child": {
       "#operator": "Sequence",
       "~children": [
       {
       "#operator": "Filter",
       "condition": "(10 < `a`)"
       },
       {
       "#operator": "InitialGroup",
       "aggregates": [
       "count(*)"
       ],
       "group_keys": []
       }
       ]
       }
       },
       {
       "#operator": "IntermediateGroup",
       "aggregates": [
       "count(*)"
       ],
       "group_keys": []
       },
       {
       "#operator": "FinalGroup",
       "aggregates": [
       "count(*)"
       ],
       "group_keys": []
       },
       {
       "#operator": "Parallel",
       "~child": {
       "#operator": "Sequence",
       "~children": [
       {
       "#operator": "InitialProject",
       "result_terms": [
       {
       "expr": "count(*)"
       }
       ]
       },
       {
       "#operator": "FinalProject"
       }
       ]
       }
       }
       ]
       },
       "text": "select count(*) from shellTest AS a where a > 10"
       }
      ]
      

       

      Attachments

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

        Activity

          People

            Donald.haggart Donald Haggart
            chang.liu Chang Liu (Inactive)
            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