diff --git a/src/Interpreters/InterpreterSelectQuery.cpp b/src/Interpreters/InterpreterSelectQuery.cpp index 33f9deaf805..051dff19bff 100644 --- a/src/Interpreters/InterpreterSelectQuery.cpp +++ b/src/Interpreters/InterpreterSelectQuery.cpp @@ -2429,7 +2429,10 @@ void InterpreterSelectQuery::executePreLimit(QueryPlan & query_plan, bool do_not } auto limit = std::make_unique(query_plan.getCurrentDataStream(), limit_length, limit_offset); - limit->setStepDescription("preliminary LIMIT"); + if (do_not_skip_offset) + limit->setStepDescription("preliminary LIMIT (with OFFSET)"); + else + limit->setStepDescription("preliminary LIMIT (without OFFSET)"); query_plan.addStep(std::move(limit)); } } diff --git a/tests/queries/0_stateless/01562_optimize_monotonous_functions_in_order_by.reference b/tests/queries/0_stateless/01562_optimize_monotonous_functions_in_order_by.reference index 0eb7e06f724..bf9bff06959 100644 --- a/tests/queries/0_stateless/01562_optimize_monotonous_functions_in_order_by.reference +++ b/tests/queries/0_stateless/01562_optimize_monotonous_functions_in_order_by.reference @@ -5,7 +5,7 @@ FROM test_order_by ORDER BY timestamp ASC LIMIT 10 Expression (Projection) - Limit (preliminary LIMIT) + Limit (preliminary LIMIT (without OFFSET)) MergingSorted (Merge sorted streams for ORDER BY) MergeSorting (Merge sorted blocks for ORDER BY) PartialSorting (Sort each block for ORDER BY) @@ -19,7 +19,7 @@ FROM test_order_by ORDER BY toDate(timestamp) ASC LIMIT 10 Expression (Projection) - Limit (preliminary LIMIT) + Limit (preliminary LIMIT (without OFFSET)) FinishSorting Expression (Before ORDER BY) SettingQuotaAndLimits (Set limits and quota after reading from storage) @@ -33,7 +33,7 @@ ORDER BY timestamp ASC LIMIT 10 Expression (Projection) - Limit (preliminary LIMIT) + Limit (preliminary LIMIT (without OFFSET)) FinishSorting Expression (Before ORDER BY) SettingQuotaAndLimits (Set limits and quota after reading from storage) diff --git a/tests/queries/0_stateless/01576_alias_column_rewrite.reference b/tests/queries/0_stateless/01576_alias_column_rewrite.reference index c9a4c04b352..2a824e62158 100644 --- a/tests/queries/0_stateless/01576_alias_column_rewrite.reference +++ b/tests/queries/0_stateless/01576_alias_column_rewrite.reference @@ -22,7 +22,7 @@ lambda 1 optimize_read_in_order Expression (Projection) - Limit (preliminary LIMIT) + Limit (preliminary LIMIT (without OFFSET)) MergingSorted (Merge sorted streams for ORDER BY) MergeSorting (Merge sorted blocks for ORDER BY) PartialSorting (Sort each block for ORDER BY) @@ -30,13 +30,13 @@ Expression (Projection) SettingQuotaAndLimits (Set limits and quota after reading from storage) ReadFromMergeTree Expression (Projection) - Limit (preliminary LIMIT) + Limit (preliminary LIMIT (without OFFSET)) FinishSorting Expression (Before ORDER BY) SettingQuotaAndLimits (Set limits and quota after reading from storage) ReadFromMergeTree Expression (Projection) - Limit (preliminary LIMIT) + Limit (preliminary LIMIT (without OFFSET)) FinishSorting Expression (Before ORDER BY) SettingQuotaAndLimits (Set limits and quota after reading from storage)