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

if (!useful_indices_names.count(index_name))
                {
                    throw Exception(
                        ErrorCodes::INDEX_NOT_USED,
                        "Index {} is not used and setting 'force_data_skipping_indices' contains it",
                        backQuote(index_name));
                }
            }
        }
        std::atomic<size_t> sum_marks_pk = 0;
        std::atomic<size_t> sum_parts_pk = 0;
        std::atomic<size_t> total_marks_pk = 0;
        
        {
            std::atomic<size_t> total_rows{0};
            SizeLimits limits;
            if (settings.read_overflow_mode == OverflowMode::THROW && settings.max_rows_to_read)
                limits = SizeLimits(settings.max_rows_to_read, 0, settings.read_overflow_mode);
            SizeLimits leaf_limits;
            if (settings.read_overflow_mode_leaf == OverflowMode::THROW && settings.max_rows_to_read_leaf)
                leaf_limits = SizeLimits(settings.max_rows_to_read_leaf, 0, settings.read_overflow_mode_leaf);
            auto process_part = [&](size_t part_index)
            {
                auto & part = parts[part_index];
                RangesInDataPart ranges(part, part_index);
                size_t total_marks_count = part->getMarksCount();
                if (total_marks_count && part->index_granularity.hasFinalMark())
                    --total_marks_count;
                total_marks_pk.fetch_add(total_marks_count, std::memory_order_relaxed);
                if (metadata_snapshot->hasPrimaryKey())