You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "adriangb (via GitHub)" <gi...@apache.org> on 2026/08/27 01:58:52 UTC

[I] Revisit the 20-value lower bound for compact `IN`-list pruning [datafusion]

adriangb opened a new issue, #24710:
URL: https://github.com/apache/datafusion/issues/24710

   Follow-up from #24526.
   
   That PR uses the compact sorted-domain form only for lists strictly larger than `MAX_IN_LIST_SIZE` (20); at or below that, the per-value OR tree is kept. The PR documents this as a scope and compatibility choice rather than a measured threshold.
   
   The open question from review: since the compact form looks both cheaper and precision-equivalent, is there a reason to keep a lower bound at all? The answer at the time was that the benchmark keeps the 20-value case on the legacy path, so it doesn't establish anything about small lists — a focused comparison could justify broadening it.
   
   Possible outcomes:
   
   - The compact form wins everywhere, and the lower bound can go
   - There's a real crossover, in which case it's worth measuring — and it likely depends on container count as well as list length
   - 20 stays, in which case it might be worth giving the crossover its own named constant. `MAX_IN_LIST_SIZE` currently doubles as the config default and the representation threshold, so the two would move together, which doesn't seem intended.
   
   Probably wants the benchmark work first.
   


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Revisit the 20-value lower bound for compact `IN`-list pruning [datafusion]

Posted by "gruuya (via GitHub)" <gi...@apache.org>.
gruuya commented on issue #24710:
URL: https://github.com/apache/datafusion/issues/24710#issuecomment-5666180397

   > That PR uses the compact sorted-domain form only for lists strictly larger than MAX_IN_LIST_SIZE (20);
   
   Currently `build_predicate_expression` has the following condition guarding the compact representation https://github.com/apache/datafusion/blob/85d4cbb0a9a885f2fd22bfdac468844446ad70d6/datafusion/pruning/src/pruning_predicate.rs#L1777-L1778
   
   However, both of those values resolve to 20, not only `MAX_IN_LIST_SIZE`; the second one defaults to it https://github.com/apache/datafusion/blob/85d4cbb0a9a885f2fd22bfdac468844446ad70d6/datafusion/common/src/config.rs#L1414
   
   Consequently the compact pruning expression never gets built by default, whether for a direct IN clause or from a dynamic hash join pushdown, hence rendering `hash_join_inlist_pushdown_max_distinct_values`'s 150 default value inert when it comes to container-level pruning. One needs to explicitly SET it to use it.
   
   So in addition (or alternatively), i'd revisit adjusting the "upper" value too, if only to align it with `hash_join_inlist_pushdown_max_distinct_values` (which seems safe judging by the performance numbers form that pr).


-- 
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: github-unsubscribe@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org