Given that vcounter is a View, the settings limit/offset dose not work as expected.

```sql
CREATE TABLE counter (id UInt64, createdAt DateTime) ENGINE = MergeTree() ORDER BY id;
INSERT INTO counter SELECT number, now() FROM numbers(500);

CREATE VIEW vcounter AS
SELECT
    intDiv(id, 10) AS tens,
    max(createdAt) AS maxid
FROM counter
GROUP BY tens;

SELECT *
FROM vcounter
ORDER BY tens ASC
LIMIT 100
SETTINGS limit = 6, offset = 5


┌─tens─┬───────────────maxid─┐
│   47 │ 2021-12-29 13:05:23 │
└──────┴─────────────────────┘

1 rows in set. Elapsed: 0.006 sec.

```

The query should return 6 rows, instead of one. 

**Does it reproduce on recent release?**

Yes, we can reproduce it on `21.10`.

**Expected behavior**

The query should return 6 rows, instead of one.

**Additional context**

Replace view with subquery works though,

```sql
SELECT *
FROM
(
    SELECT
        intDiv(id, 10) AS tens,
        max(createdAt) AS maxid
    FROM test.counter
    GROUP BY tens
)
LIMIT 100
SETTINGS limit = 6, offset = 5;

┌─tens─┬───────────────maxid─┐
│    3 │ 2021-12-29 13:05:23 │
│   31 │ 2021-12-29 13:05:23 │
│   47 │ 2021-12-29 13:05:23 │
│   40 │ 2021-12-29 13:05:23 │
│   30 │ 2021-12-29 13:05:23 │
│    2 │ 2021-12-29 13:05:23 │
└──────┴─────────────────────┘

6 rows in set. Elapsed: 0.011 sec. 
```

}
    select_ast->setExpression(ASTSelectQuery::Expression::TABLES, std::make_shared<ASTTablesInSelectQuery>());
    auto tables = select_ast->tables();
    auto tables_elem = std::make_shared<ASTTablesInSelectQueryElement>();
    auto table_expr = std::make_shared<ASTTableExpression>();
    tables->children.push_back(tables_elem);
    tables_elem->table_expression = table_expr;
    tables_elem->children.push_back(table_expr);
    table_expr->database_and_table_name = std::make_shared<ASTTableIdentifier>(db_name, table_name);
    table_expr->children.push_back(table_expr->database_and_table_name);
    
    auto syntax_result = TreeRewriter(context).analyzeSelect(query_ast, TreeRewriterResult({}, storage, metadata_snapshot));
    SelectQueryExpressionAnalyzer analyzer(query_ast, syntax_result, context, metadata_snapshot);
    actions = analyzer.simpleSelectActions();
    auto column_name = expr_list->children.at(0)->getColumnName();
    actions->removeUnusedActions(NameSet{column_name});
    actions->projectInput(false);
    for (const auto * node : actions->getInputs())
        actions->getIndex().push_back(node);
    return column_name;
}
InterpreterSelectQuery::InterpreterSelectQuery(
    const ASTPtr & query_ptr_,
    ContextPtr context_,
    const SelectQueryOptions & options_,
    const Names & required_result_column_names_)
    : InterpreterSelectQuery(query_ptr_, context_, std::nullopt, nullptr, options_, required_result_column_names_)
{
}
InterpreterSelectQuery::InterpreterSelectQuery(