```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".

minmax_idx_condition,
                minmax_columns_types,
                partition_pruner,
                max_block_numbers_to_read,
                query_context,
                part_filter_counters);
        else
            selectPartsToRead(
                parts,
                part_values,
                minmax_idx_condition,
                minmax_columns_types,
                partition_pruner,
                max_block_numbers_to_read,
                part_filter_counters);
        index_stats->emplace_back(ReadFromMergeTree::IndexStat{
            .type = ReadFromMergeTree::IndexType::None,
            .num_parts_after = part_filter_counters.num_initial_selected_parts,
            .num_granules_after = part_filter_counters.num_initial_selected_granules});
        if (minmax_idx_condition)
        {
            auto description = minmax_idx_condition->getDescription();
            index_stats->emplace_back(ReadFromMergeTree::IndexStat{
                .type = ReadFromMergeTree::IndexType::MinMax,
                .condition = std::move(description.condition),
                .used_keys = std::move(description.used_keys),
                .num_parts_after = part_filter_counters.num_parts_after_minmax,
                .num_granules_after = part_filter_counters.num_granules_after_minmax});
            LOG_DEBUG(log, "MinMax index condition: {}", minmax_idx_condition->toString());
        }