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

n1ql does not honor order-by for aggregate push-down on partitioned index

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.5.0
    • 5.5.0
    • query
    • None
    • Untriaged
    • Unknown

    Description

      Using beer-sample, create a partitioned index with (1) index-key matches group-by key, (2) index-key matches partition key.

      create index category on `beer-sample`(category) partition by hash(category);

      Aggregate query is push-down to partitioned index, expecting full-aggregate result. Gsi client returns full aggregated result in sorted order, but the final query result is not in sorted order.

      cbq> select category, count(category) from `beer-sample` where category is not missing group by category order by category;
      {
      "requestID": "7828e134-f4b3-4c9c-aa48-61f41ac0042f",
      "signature":

      { "$1": "number", "category": "json" }

      ,
      "results": [

      { "$1": 564, "category": "North American Lager" }

      ,

      { "$1": 327, "category": "Belgian and French Ale" }

      ,

      { "$1": 320, "category": "British Ale" }

      ,

      { "$1": 1996, "category": "North American Ale" }

      ,

      { "$1": 4, "category": "Other Lager" }

      ,

      { "$1": 218, "category": "German Ale" }

      ,

      { "$1": 285, "category": "Irish Ale" }

      ,

      { "$1": 268, "category": "Other Style" }

      ,

      { "$1": 441, "category": "German Lager" }

      ],
      "status": "success",
      "metrics":

      { "elapsedTime": "27.064367ms", "executionTime": "27.046865ms", "resultCount": 9, "resultSize": 672 }

      }

      Attachments

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

        Activity

          People

            arunkumar Arunkumar Senthilnathan (Inactive)
            jliang John Liang
            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