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

LIMIT is not pushed down on indices with leading key as meta().id.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • 4.5.0
    • 4.5.0
    • query
    • Untriaged
    • Yes

    Description

      create index i3 on `beer-sample`(meta().id, city);
      explain select city from `beer-sample` where meta().id >= "M" limit 10; This LIMIT isn’t pushed to index scan. If I create index on other fields city/etc alone, that LIMIT gets pushed down.
      [
      {
      "plan": {
      "#operator": "Sequence",
      "~children": [
      {
      "#operator": "Sequence",
      "~children": [
      {
      "#operator": "IndexScan",
      "covers": [
      "cover ((meta(`beer-sample`).`id`))",
      "cover ((`beer-sample`.`city`))",
      "cover ((meta(`beer-sample`).`id`))"
      ],
      "index": "i3",
      "index_id": "b21159b6dc4e192",
      "keyspace": "beer-sample",
      "namespace": "default",
      "spans": [
      {
      "Range":

      { "Inclusion": 1, "Low": [ "\"M\"" ] }

      }
      ],
      "using": "gsi"
      },
      {
      "#operator": "Parallel",
      "~child": {
      "#operator": "Sequence",
      "~children": [

      { "#operator": "Filter", "condition": "(\"M\" <= cover ((meta(`beer-sample`).`id`)))" }

      ,
      {
      "#operator": "InitialProject",
      "result_terms": [

      { "expr": "cover ((`beer-sample`.`city`))" }

      ]
      },

      { "#operator": "FinalProject" }

      ]
      }
      }
      ]
      },

      { "#operator": "Limit", "expr": "10" }

      ]
      },
      "text": "select city from `beer-sample` where meta().id >= \"M\" limit 10;"
      }
      ]

      Attachments

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

        Activity

          People

            Sitaram.Vemulapalli Sitaram Vemulapalli
            keshav Keshav Murthy
            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