This is an issue similar to https://github.com/ClickHouse/ClickHouse/issues/7617 but with slight difference.

I am seeing optimize_read_in_order working in MergeTree table but not honored by Merge table on top of it, the issue can be reproduced on ClickHouse server version 20.12.4 revision 54442 through the following commands:

**Table Setup:**
_create table mt( A Int64, B Int64, V Int64) Engine=MergeTree order by (A,-B)_

_create table m as mt ENGINE = Merge(default, 'mt')_

_insert into mt select 111, number, number from numbers(10000000)_





**Queries:**
Selecting on the MergeTree table honors optimize_read_in_order and only processes 400K rows:
```
select * from mt where A = 111 order by A,-B limit 3 settings max_threads=1,optimize_read_in_order=1;
┌───A─┬───────B─┬───────V─┐
│ 111 │ 9999999 │ 9999999 │
│ 111 │ 9999998 │ 9999998 │
│ 111 │ 9999997 │ 9999997 │
└─────┴─────────┴─────────┘
3 rows in set. Elapsed: 0.048 sec. Processed 409.60 thousand rows, 9.83 MB (8.46 million rows/s., 203.06 MB/s.)
```

Selecting on the Merge table does not honor optimize_read_in_order and processes all 10M rows:
```
┌───A─┬───────B─┬───────V─┐
│ 111 │ 9999999 │ 9999999 │
│ 111 │ 9999999 │ 9999999 │
│ 111 │ 9999998 │ 9999998 │
└─────┴─────────┴─────────┘
select * from m where A = 111 order by A,-B limit 3 settings max_threads=1,optimize_read_in_order=1;
3 rows in set. Elapsed: 0.424 sec. Processed 10.00 million rows, 240.00 MB (23.56 million rows/s., 565.48 MB/s.)
```



auto * order_by_element = order_by->children[i]->as<ASTOrderByElement>();
        auto & ast_func = order_by_element->children[0];
        if (!ast_func->as<ASTFunction>())
            continue;
        if (i >= sorting_key_columns.size() || ast_func->getColumnName() != sorting_key_columns[i])
            is_sorting_key_prefix = false;
        
        
        if (is_sorting_key_prefix)
            continue;
        MonotonicityCheckVisitor::Data data{tables_with_columns, context, group_by_hashes};
        MonotonicityCheckVisitor(data).visit(ast_func);
        if (!data.isRejected())
        {
            ast_func = data.identifier->clone();
            ast_func->setAlias("");
            if (!data.monotonicity.is_positive)
                order_by_element->direction *= -1;
        }
    }
}
void optimizeRedundantFunctionsInOrderBy(const ASTSelectQuery * select_query, ContextPtr context)
{
    const auto & order_by = select_query->orderBy();
    if (!order_by)
        return;
    for (const auto & child : order_by->children)
    {
        auto * order_by_element = child->as<ASTOrderByElement>();
        if (!order_by_element || order_by_element->children.empty())