SELECT count(stars) from
reviews
where stars > 4

distribute result [$$28]
-- DISTRIBUTE_RESULT  |UNPARTITIONED|
  exchange
  -- ONE_TO_ONE_EXCHANGE  |UNPARTITIONED|
    project ([$$28])
    -- STREAM_PROJECT  |UNPARTITIONED|
      assign [$$28] <- [{"$1": $$31}]
      -- ASSIGN  |UNPARTITIONED|
        aggregate [$$31] <- [agg-sql-sum($$34)]
        -- AGGREGATE  |UNPARTITIONED|
          exchange
          -- RANDOM_MERGE_EXCHANGE  |PARTITIONED|
            aggregate [$$34] <- [agg-sql-count($$32)]
            -- AGGREGATE  |PARTITIONED|
              select (gt($$32, 4))
              -- STREAM_SELECT  |PARTITIONED|
                project ([$$32])
                -- STREAM_PROJECT  |PARTITIONED|
                  assign [$$32] <- [$$reviews.getField("stars")]
                  -- ASSIGN  |PARTITIONED|
                    project ([$$reviews])
                    -- STREAM_PROJECT  |PARTITIONED|
                      exchange
                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                        unnest-map [$$29, $$reviews, $$30] <- index-search("reviews", 0, "Default", "reviews", FALSE, FALSE, 1, $$37, 1, $$37, TRUE, TRUE, TRUE)
                        -- BTREE_SEARCH  |PARTITIONED|
                          exchange
                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                            order (ASC, $$37) 
                            -- STABLE_SORT [$$37(ASC)]  |PARTITIONED|
                              exchange
                              -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                project ([$$37])
                                -- STREAM_PROJECT  |PARTITIONED|
                                  exchange
                                  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                    unnest-map [$$36, $$37] <- index-search("r_stars", 0, "Default", "reviews", FALSE, FALSE, 1, $$35, 0, TRUE, TRUE, FALSE)
                                    -- BTREE_SEARCH  |PARTITIONED|
                                      exchange
                                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                        assign [$$35] <- [4]
                                        -- ASSIGN  |PARTITIONED|
                                          empty-tuple-source
                                          -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
