```sql
SELECT count()
FROM 
(
    SELECT number
    FROM numbers_mt(100000000)
    ORDER BY number DESC
    LIMIT 100
    UNION ALL
    SELECT number
    FROM numbers_mt(100000000)
    ORDER BY number DESC
    LIMIT 100
    UNION ALL
    SELECT number
    FROM numbers_mt(100000000)
    ORDER BY number DESC
    LIMIT 100
)


SET experimental_use_processors = 0;
-- 1 rows in set. Elapsed: 1.581 sec. Processed 300.00 million rows, 2.40 GB (189.78 million rows/s., 1.52 GB/s.) 

SET experimental_use_processors = 1;
-- 1 rows in set. Elapsed: 3.569 sec. Processed 300.00 million rows, 2.40 GB (84.06 million rows/s., 672.50 MB/s.) 
```

Similar for MergeTree:

```sql
create table test engine=MergeTree order by tuple() as select * from numbers(30000000);

select count() from (select number from test group by number order by number limit 10 union all select number from test group by number order by number limit 10);

set experimental_use_processors=0;
-- Elapsed: 2.664 sec

set experimental_use_processors=1;
-- Elapsed: 3.656 sec
```
{
            pipeline.addSimpleTransform([&](const Block & header)
            {
               return std::make_shared<ConvertingTransform>(
                       header, common_header, ConvertingTransform::MatchColumnsMode::Position);
            });
        }
        if (pipeline.extremes_port)
        {
            auto converting = std::make_shared<ConvertingTransform>(
                pipeline.current_header, common_header, ConvertingTransform::MatchColumnsMode::Position);
            connect(*pipeline.extremes_port, converting->getInputPort());
            extremes.push_back(&converting->getOutputPort());
            processors.emplace(std::move(converting));
        }
        
        if (pipeline.totals_having_port)
        {
            auto converting = std::make_shared<ConvertingTransform>(
                pipeline.current_header, common_header, ConvertingTransform::MatchColumnsMode::Position);
            connect(*pipeline.totals_having_port, converting->getInputPort());
            totals.push_back(&converting->getOutputPort());
            processors.emplace(std::move(converting));
        }
        auto * collector = processors.setCollectedProcessors(nullptr);
        processors.emplace(pipeline.processors.detach());
        processors.setCollectedProcessors(collector);
        streams.addStreams(pipeline.streams);
        table_locks.insert(table_locks.end(), std::make_move_iterator(pipeline.table_locks.begin()), std::make_move_iterator(pipeline.table_locks.end()));
        interpreter_context.insert(interpreter_context.end(), pipeline.interpreter_context.begin(), pipeline.interpreter_context.end());