```sql
DROP TABLE IF EXISTS tp;

create table tp (d1 Int32, d2 Int32, eventcnt Int64,
projection p (select sum(eventcnt), d1 group by d1)) 
engine = SummingMergeTree order by (d1, d2);

set allow_experimental_projection_optimization = 1, force_optimize_projection = 1;

select sum(eventcnt) eventcnt, d1
from tp
group by d1;

DB::Exception: No projection is used when allow_experimental_projection_optimization = 1.

```

The exception message is also incorrect, should be "when force_optimize_projection = 1".

: index(index_), condition(condition_)
            {
            }
        };
        std::list<DataSkippingIndexAndCondition> useful_indices;
        for (const auto & index : metadata_snapshot->getSecondaryIndices())
        {
            auto index_helper = MergeTreeIndexFactory::instance().get(index);
            auto condition = index_helper->createIndexCondition(query_info, context);
            if (!condition->alwaysUnknownOrTrue())
                useful_indices.emplace_back(index_helper, condition);
        }
        if (settings.force_data_skipping_indices.changed)
        {
            const auto & indices = settings.force_data_skipping_indices.toString();
            Strings forced_indices;
            {
                Tokens tokens(&indices[0], &indices[indices.size()], settings.max_query_size);
                IParser::Pos pos(tokens, settings.max_parser_depth);
                Expected expected;
                if (!parseIdentifiersOrStringLiterals(pos, expected, forced_indices))
                    throw Exception(ErrorCodes::CANNOT_PARSE_TEXT, "Cannot parse force_data_skipping_indices ('{}')", indices);
            }
            if (forced_indices.empty())
                throw Exception(ErrorCodes::CANNOT_PARSE_TEXT, "No indices parsed from force_data_skipping_indices ('{}')", indices);
            std::unordered_set<std::string> useful_indices_names;
            for (const auto & useful_index : useful_indices)
                useful_indices_names.insert(useful_index.index->index.name);
            for (const auto & index_name : forced_indices)
            {