ZhangYu0123 commented on code in PR #18692: URL: https://github.com/apache/doris/pull/18692#discussion_r1168181847
########## 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. locale(subStr, str, pos) , this function parameter is subStr, str, pos. On one hand, subStr is likely to be constant. On the other hand, because of init stringsearch is a waste of time, so optimize left col is more benefit than the right col. -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org