You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zclllyybb (via GitHub)" <gi...@apache.org> on 2023/04/17 03:42:58 UTC

[GitHub] [doris] zclllyybb commented on a diff in pull request #18692: [optimize](string) optimize instr and locate function for constant arguments

zclllyybb commented on code in PR #18692:
URL: https://github.com/apache/doris/pull/18692#discussion_r1168127145


##########
be/src/vec/functions/function_string.h:
##########
@@ -2292,30 +2292,76 @@ class FunctionStringLocatePos : public IFunction {
 
     Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
                         size_t result, size_t input_rows_count) override {
-        auto col_substr =
-                block.get_by_position(arguments[0]).column->convert_to_full_column_if_const();
-        auto col_str =
+        const auto& left = block.get_by_position(arguments[0]);
+        const auto& right =

Review Comment:
   maybe the right column seems more likely to be constant? If so, we should optimize for `rcol` but not `lcol` and use `default_preprocess_parameter_columns` to deal with other columns. Then our dispatcher could distinguish by wether `lcol` and `pos` are all const.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org