github-actions[bot] commented on code in PR #62532:
URL: https://github.com/apache/doris/pull/62532#discussion_r3087217442


##########
be/src/exprs/create_predicate_function.h:
##########
@@ -50,6 +50,9 @@ class HybridSetTraits {
     static BasePtr get_function(bool null_aware) {
         if constexpr (is_string_type(type)) {
             return new StringSet<>(null_aware);
+        } else if constexpr (type == TYPE_TINYINT || type == TYPE_SMALLINT) {

Review Comment:
   `create_set()` is also used by `FunctionIn::impl_without_set()` 
(`be/src/exprs/function/in.h`) for non-constant RHS expressions, and that path 
builds a temporary set **per input row**. With this branch ahead of the 
existing `N <= FIXED_CONTAINER_MAX_SIZE` check, every `SMALLINT` fallback set 
now becomes a `BitSetContainer<int16_t>` even when the RHS only has 1-8 
elements. That means each row pays for allocating and zero-filling a 
65,536-slot container instead of using the previous fixed-container fast path. 
For queries like `smallint_col IN (other_smallint1, other_smallint2, ...)`, 
this turns the fallback into ~64 KiB of work per row and can easily dominate 
execution time. Please keep the small-`N` `FixedContainer` path and only choose 
`BitSetContainer` once the cardinality is large enough to amortize its 
initialization cost.`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to