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

[CX] Remove listify in the query plan for a complex group-by

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • CBAS DP3
    • CBAS DP3
    • analytics
    • None
    • CX Sprint 66

    Description

      The following query results in listifies in the optimized query plan.

      USE tpch;
      SELECT l_returnflag AS l_returnflag,
      l_linestatus AS l_linestatus,
      coll_count(cheap) AS count_cheaps,
      coll_count(expensive) AS count_expensives
      FROM LineItem AS l
      WHERE l.l_shipdate <= '1998-09-02'
      /* +hash */
      GROUP BY l.l_returnflag AS l_returnflag,l.l_linestatus AS l_linestatus
      GROUP AS g
      LET cheap = (
      SELECT ELEMENT m
      FROM (FROM g SELECT VALUE l) AS m
      WHERE m.l_discount > 0.05
      ),
      expensive = (
      SELECT ELEMENT a
      FROM (FROM g SELECT VALUE l) AS a
      WHERE a.l_discount <= 0.05
      )
      ORDER BY l_returnflag,l_linestatus
      ;

      Attachments

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

        Activity

          People

            dmitry.lychagin Dmitry Lychagin (Inactive)
            yingyi Yingyi Bu (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