local exchange (GATHER, SINGLE, [])
    remote exchange (GATHER, SINGLE, [])
        final hashaggregation over (c_first_name, c_last_name)
            local exchange (GATHER, SINGLE, [])
                remote exchange (REPARTITION, HASH, ["c_first_name", "c_last_name"])
                    partial hashaggregation over (c_first_name, c_last_name)
                        Filter
                            semijoin (PARTITIONED):
                                remote exchange (REPARTITION, HASH, ["cs_bill_customer_sk"])
                                    Filter
                                        semijoin (PARTITIONED):
                                            remote exchange (REPARTITION, HASH, ["cs_item_sk"])
                                                join (INNER, PARTITIONED):
                                                    remote exchange (REPARTITION, HASH, ["cs_bill_customer_sk"])
                                                        join (INNER, REPLICATED):
                                                            Filter
                                                                scan catalog_sales
                                                            local exchange (GATHER, SINGLE, [])
                                                                remote exchange (REPLICATE, BROADCAST, [])
                                                                    Filter
                                                                        scan date_dim
                                                    local exchange (GATHER, SINGLE, [])
                                                        remote exchange (REPARTITION, HASH, ["c_customer_sk"])
                                                            Filter
                                                                scan customer
                                            local exchange (GATHER, SINGLE, [])
                                                remote exchange (REPARTITION, HASH, ["ss_item_sk"])
                                                    remote exchange (REPARTITION, HASH, ["count_31", "d_date_3", "ss_item_sk", "substr"])
                                                        cte frequent_ss_items
                                                            Filter
                                                                final hashaggregation over (d_date_3, ss_item_sk, substr)
                                                                    local exchange (GATHER, SINGLE, [])
                                                                        remote exchange (REPARTITION, HASH, ["d_date_3", "ss_item_sk", "substr"])
                                                                            partial hashaggregation over (d_date_3, ss_item_sk, substr)
                                                                                join (INNER, REPLICATED):
                                                                                    join (INNER, REPLICATED):
                                                                                        Filter
                                                                                            scan store_sales
                                                                                        local exchange (GATHER, SINGLE, [])
                                                                                            remote exchange (REPLICATE, BROADCAST, [])
                                                                                                Filter
                                                                                                    scan date_dim
                                                                                    local exchange (GATHER, SINGLE, [])
                                                                                        remote exchange (REPLICATE, BROADCAST, [])
                                                                                            scan item
                                local exchange (GATHER, SINGLE, [])
                                    remote exchange (REPARTITION, HASH, ["ss_customer_sk_50"])
                                        remote exchange (REPARTITION, HASH, ["ss_customer_sk_50", "sum"])
                                            cte best_ss_customer
                                                Filter
                                                    cross join:
                                                        final hashaggregation over (ss_customer_sk_50)
                                                            local exchange (GATHER, SINGLE, [])
                                                                partial hashaggregation over (ss_customer_sk_50)
                                                                    join (INNER, PARTITIONED):
                                                                        remote exchange (REPARTITION, HASH, ["ss_customer_sk_50"])
                                                                            scan store_sales
                                                                        local exchange (GATHER, SINGLE, [])
                                                                            remote exchange (REPARTITION, HASH, ["c_customer_sk_70"])
                                                                                scan customer
                                                        local exchange (GATHER, SINGLE, [])
                                                            remote exchange (REPLICATE, BROADCAST, [])
                                                                local exchange (GATHER, SINGLE, [])
                                                                    remote exchange (GATHER, SINGLE, [])
                                                                        cte max_store_sales
                                                                            final hashaggregation over ()
                                                                                local exchange (GATHER, SINGLE, [])
                                                                                    remote exchange (GATHER, SINGLE, [])
                                                                                        partial hashaggregation over ()
                                                                                            final hashaggregation over (ss_customer_sk_98)
                                                                                                local exchange (GATHER, SINGLE, [])
                                                                                                    partial hashaggregation over (ss_customer_sk_98)
                                                                                                        join (INNER, REPLICATED):
                                                                                                            join (INNER, PARTITIONED):
                                                                                                                remote exchange (REPARTITION, HASH, ["ss_customer_sk_98"])
                                                                                                                    Filter
                                                                                                                        scan store_sales
                                                                                                                local exchange (GATHER, SINGLE, [])
                                                                                                                    remote exchange (REPARTITION, HASH, ["c_customer_sk_118"])
                                                                                                                        scan customer
                                                                                                            local exchange (GATHER, SINGLE, [])
                                                                                                                remote exchange (REPLICATE, BROADCAST, [])
                                                                                                                    Filter
                                                                                                                        scan date_dim
        final hashaggregation over (c_first_name_202, c_last_name_203)
            local exchange (GATHER, SINGLE, [])
                remote exchange (REPARTITION, HASH, ["c_first_name_202", "c_last_name_203"])
                    partial hashaggregation over (c_first_name_202, c_last_name_203)
                        Filter
                            semijoin (PARTITIONED):
                                remote exchange (REPARTITION, HASH, ["ws_bill_customer_sk"])
                                    Filter
                                        semijoin (PARTITIONED):
                                            remote exchange (REPARTITION, HASH, ["ws_item_sk"])
                                                join (INNER, PARTITIONED):
                                                    remote exchange (REPARTITION, HASH, ["ws_bill_customer_sk"])
                                                        join (INNER, REPLICATED):
                                                            Filter
                                                                scan web_sales
                                                            local exchange (GATHER, SINGLE, [])
                                                                remote exchange (REPLICATE, BROADCAST, [])
                                                                    Filter
                                                                        scan date_dim
                                                    local exchange (GATHER, SINGLE, [])
                                                        remote exchange (REPARTITION, HASH, ["c_customer_sk_194"])
                                                            Filter
                                                                scan customer
                                            local exchange (GATHER, SINGLE, [])
                                                remote exchange (REPARTITION, HASH, ["ss_item_sk_243"])
                                                    remote exchange (REPARTITION, HASH, ["count_321", "d_date_266", "ss_item_sk_243", "substr_314"])
                                                        cte frequent_ss_items
                                                            Filter
                                                                final hashaggregation over (d_date_266, ss_item_sk_243, substr_314)
                                                                    local exchange (GATHER, SINGLE, [])
                                                                        remote exchange (REPARTITION, HASH, ["d_date_266", "ss_item_sk_243", "substr_314"])
                                                                            partial hashaggregation over (d_date_266, ss_item_sk_243, substr_314)
                                                                                join (INNER, REPLICATED):
                                                                                    join (INNER, REPLICATED):
                                                                                        Filter
                                                                                            scan store_sales
                                                                                        local exchange (GATHER, SINGLE, [])
                                                                                            remote exchange (REPLICATE, BROADCAST, [])
                                                                                                Filter
                                                                                                    scan date_dim
                                                                                    local exchange (GATHER, SINGLE, [])
                                                                                        remote exchange (REPLICATE, BROADCAST, [])
                                                                                            scan item
                                local exchange (GATHER, SINGLE, [])
                                    remote exchange (REPARTITION, HASH, ["ss_customer_sk_342"])
                                        remote exchange (REPARTITION, HASH, ["ss_customer_sk_342", "sum_384"])
                                            cte best_ss_customer
                                                Filter
                                                    cross join:
                                                        final hashaggregation over (ss_customer_sk_342)
                                                            local exchange (GATHER, SINGLE, [])
                                                                partial hashaggregation over (ss_customer_sk_342)
                                                                    join (INNER, PARTITIONED):
                                                                        remote exchange (REPARTITION, HASH, ["ss_customer_sk_342"])
                                                                            scan store_sales
                                                                        local exchange (GATHER, SINGLE, [])
                                                                            remote exchange (REPARTITION, HASH, ["c_customer_sk_362"])
                                                                                scan customer
                                                        local exchange (GATHER, SINGLE, [])
                                                            remote exchange (REPLICATE, BROADCAST, [])
                                                                local exchange (GATHER, SINGLE, [])
                                                                    remote exchange (GATHER, SINGLE, [])
                                                                        cte max_store_sales
                                                                            final hashaggregation over ()
                                                                                local exchange (GATHER, SINGLE, [])
                                                                                    remote exchange (GATHER, SINGLE, [])
                                                                                        partial hashaggregation over ()
                                                                                            final hashaggregation over (ss_customer_sk_392)
                                                                                                local exchange (GATHER, SINGLE, [])
                                                                                                    partial hashaggregation over (ss_customer_sk_392)
                                                                                                        join (INNER, REPLICATED):
                                                                                                            join (INNER, PARTITIONED):
                                                                                                                remote exchange (REPARTITION, HASH, ["ss_customer_sk_392"])
                                                                                                                    Filter
                                                                                                                        scan store_sales
                                                                                                                local exchange (GATHER, SINGLE, [])
                                                                                                                    remote exchange (REPARTITION, HASH, ["c_customer_sk_412"])
                                                                                                                        scan customer
                                                                                                            local exchange (GATHER, SINGLE, [])
                                                                                                                remote exchange (REPLICATE, BROADCAST, [])
                                                                                                                    Filter
                                                                                                                        scan date_dim
