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

Limit incorrectly pushed to scan when index aggregates are not used.

    XMLWordPrintable

Details

    • Untriaged
    • 0
    • Unknown

    Description

      SELECT type, COUNT(1)
      FROM `travel-sample`
      GROUP BY type
      LIMIT 2

      Returns a single type with a count of 2, instead of 2 types (with their relevant counts).

      (Add WHERE type IS VALUED to get an index scan with aggregates and you get the expected results.)

      Plan shows:

                                  "#operator": "PrimaryScan3",
                                  "index": "def_primary",
                                  "index_projection": {
                                      "primary_key": true
                                  },
                                  "keyspace": "travel-sample",
                                  "limit": "2",
      

      Attachments

        Activity

          People

            bingjie.miao Bingjie Miao
            Donald.haggart Donald Haggart
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              PagerDuty