feat: combine non-overlapping chunks without deletes

pull/24376/head
Raphael Taylor-Davies 2022-02-02 16:40:30 +00:00
parent 62a2ad289b
commit 8a8de19fb5
2 changed files with 12 additions and 21 deletions

View File

@ -441,15 +441,14 @@ impl<C: QueryChunk + 'static> Deduplicater<C> {
}
// Go over non_duplicates_chunks, build a plan for it
for no_duplicates_chunk in self.no_duplicates_chunks.to_vec() {
plans.push(Self::build_plan_for_non_duplicates_chunk(
Arc::clone(&table_name),
Arc::clone(&output_schema),
no_duplicates_chunk.to_owned(),
predicate.clone(),
&output_sort_key,
)?);
}
let mut non_duplicate_plans = Self::build_plans_for_non_duplicates_chunks(
Arc::clone(&table_name),
Arc::clone(&output_schema),
self.no_duplicates_chunks.to_vec(),
predicate,
&output_sort_key,
)?;
plans.append(&mut non_duplicate_plans);
}
if plans.is_empty() {

View File

@ -19,9 +19,7 @@
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | IOxReadFilterNode: table_name=h2o, chunks=2 predicate=Predicate |
| | |
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------+
-- SQL: EXPLAIN select time, state, city, min_temp, max_temp, area from h2o;
@ -41,9 +39,7 @@
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | IOxReadFilterNode: table_name=h2o, chunks=2 predicate=Predicate |
| | |
+---------------+-----------------------------------------------------------------------------------------------------------------------------------------+
-- SQL: EXPLAIN select state as name from h2o UNION ALL select city as name from h2o;
@ -68,9 +64,7 @@
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | IOxReadFilterNode: table_name=h2o, chunks=2 predicate=Predicate |
| | ProjectionExec: expr=[city@0 as name] |
| | UnionExec |
| | ProjectionExec: expr=[city@0 as city] |
@ -83,8 +77,6 @@
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | RepartitionExec: partitioning=RoundRobinBatch(4) |
| | IOxReadFilterNode: table_name=h2o, chunks=1 predicate=Predicate |
| | IOxReadFilterNode: table_name=h2o, chunks=2 predicate=Predicate |
| | |
+---------------+-----------------------------------------------------------------------------------+