[
https://issues.apache.org/jira/browse/ARROW-11058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17256132#comment-17256132
]
Jorge Leitão commented on ARROW-11058:
--------------------------------------
Thank you so much for your explanation, [~andygrove] . I agree with that.
Maybe this is too obvious and I am just not knowledgeable here: what is the
problem with P = B? I.e. what do we gain from having both a batch size and
number of parts, instead of having just one batch per part?
I am asking this because it seems to me that we have a fragmentation problem:
we start with a bunch of contiguous blocks of memory, and as we operate on
them, we fragement / filter them in smaller and smaller parts, that, at some
point, make them slow to operate individually (and we defragment via coalesces
to bring them back together). Just like in a OS.
With (P,B), we need to deal with fragmentation both at the partition level and
batch level: we need to worry about having a partition that is balanced (in
number of rows per part), and also have each part balanced (in number of rows
per batch on each part).
Wouldn't be simpler if P=B, where we only need to worry about fragmentation of
parts (and coalesce parts)? I suspect that that would be too simple, i.e. I am
missing the benefit of the extra degree of freedom (P,B) vs (P=B).
> [Rust] [DataFusion] Implement "coalesce batches" operator
> ---------------------------------------------------------
>
> Key: ARROW-11058
> URL: https://issues.apache.org/jira/browse/ARROW-11058
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Rust - DataFusion
> Reporter: Andy Grove
> Assignee: Andy Grove
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.0.0
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> When we have a FilterExec in the plan, it can produce lots of small batches
> and we therefore lose efficiency of vectorized operations.
> We should implement a new CoalesceBatchExec and wrap every FilterExec with
> one of these so that small batches can be recombined into larger batches to
> improve the efficiency of upstream operators.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)