(you don't have to strictly follow this form)

**Describe the bug**
A link to the report: https://s3.amazonaws.com/clickhouse-test-reports/35466/d81c58b5d9be45ac69c3859b5cbe97080711f6d9/fuzzer_astfuzzerubsan,actions//report.html
The commit: https://github.com/ClickHouse/ClickHouse/commit/d81c58b5d9be45ac69c3859b5cbe97080711f6d9
if (max_streams > 1 && !is_remote)
            max_streams *= settings.max_streams_to_max_threads_ratio;
        auto & prewhere_info = analysis_result.prewhere_info;
        if (prewhere_info)
            query_info.prewhere_info = prewhere_info;
        
        
        if ((analysis_result.optimize_read_in_order || analysis_result.optimize_aggregation_in_order)
            && (!query_info.projection || query_info.projection->complete))
        {
            if (analysis_result.optimize_read_in_order)
            {
                if (query_info.projection)
                {
                    query_info.projection->order_optimizer = std::make_shared<ReadInOrderOptimizer>(
                        
                        query,
                        analysis_result.order_by_elements_actions,
                        getSortDescription(query, context),
                        query_info.syntax_analyzer_result);
                }
                else
                {
                    query_info.order_optimizer = std::make_shared<ReadInOrderOptimizer>(
                        query,
                        analysis_result.order_by_elements_actions,
                        getSortDescription(query, context),
                        query_info.syntax_analyzer_result);
                }