Performance of ORDER BY on sorting key prefix with braces is 2x slower than without due to inefficient execution plan.
Without braces:
```sql
EXPLAIN PIPELINE
SELECT
    CounterID,
    EventDate
FROM hits_v1
ORDER BY
    CounterID ASC,
    EventDate ASC

┌─explain───────────────────────────┐
│ (Expression)                      │
│ ExpressionTransform               │
│   (Sorting)                       │
│   MergingSortedTransform 19 → 1   │
│     (Expression)                  │
│     ExpressionTransform × 19      │
│       (ReadFromMergeTree)         │
│       MergeTreeInOrder × 19 0 → 1 │
└───────────────────────────────────┘
```
With braces:
```sql
EXPLAIN PIPELINE
SELECT
    CounterID,
    EventDate
FROM hits_v1
ORDER BY (CounterID, EventDate) ASC

┌─explain────────────────────────────────┐
│ (Expression)                           │
│ ExpressionTransform                    │
│   (Sorting)                            │
│   MergingSortedTransform 16 → 1        │
│     MergeSortingTransform × 16         │
│       LimitsCheckingTransform × 16     │
│         PartialSortingTransform × 16   │
│           (Expression)                 │
│           ExpressionTransform × 16     │
│             (ReadFromMergeTree)        │
│             MergeTreeThread × 16 0 → 1 │
└────────────────────────────────────────┘
```
{
    
    if (!query.distinct && !query.limitBy() && !query.limit_with_ties && !query.arrayJoinExpressionList().first && query.limitLength())
    {
        auto [limit_length, limit_offset] = getLimitLengthAndOffset(query, context_);
        if (limit_length > std::numeric_limits<UInt64>::max() - limit_offset)
            return 0;
        return limit_length + limit_offset;
    }
    return 0;
}
static bool hasWithTotalsInAnySubqueryInFromClause(const ASTSelectQuery & query)
{
    if (query.group_by_with_totals)
        return true;
    /** NOTE You can also check that the table in the subquery is distributed, and that it only looks at one shard.
     * In other cases, totals will be computed on the initiating server of the query, and it is not necessary to read the data to the end.
     */
    if (auto query_table = extractTableExpression(query, 0))
    {
        if (const auto * ast_union = query_table->as<ASTSelectWithUnionQuery>())
        {
            /** NOTE
            * 1. For ASTSelectWithUnionQuery after normalization for union child node the height of the AST tree is at most 2.
            * 2. For ASTSelectIntersectExceptQuery after normalization in case there are intersect or except nodes,
            * the height of the AST tree can have any depth (each intersect/except adds a level), but the
            * number of children in those nodes is always 2.
            */