Class MergePages
- java.lang.Object
-
- io.prestosql.operator.project.MergePages
-
public final class MergePages extends Object
This class is intended to be used right after the PageProcessor to ensure that the size of the pages returned by FilterAndProject and ScanFilterAndProject is big enough so it does not introduce considerable synchronization overhead.As long as the input page contains more than
MergePages.MergePagesTransformation.minRowCount
rows or is bigger thanMergePages.MergePagesTransformation.minPageSizeInBytes
it is returned as is without additional memory copy.The page data that has been buffered so far before receiving a "big" page is being flushed before transferring a "big" page.
Although it is still possible that the
MergePages
may return a tiny page, this situation is considered to be rare due to the assumption that filter selectivity may not vary a lot based on the particular input page.Considering the CPU time required to process(filter, project) a full (~1MB) page returned by a connector, the CPU cost of memory copying (< 50kb, < 1024 rows) is supposed to be negligible.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WorkProcessor<Page>
mergePages(Iterable<? extends Type> types, long minPageSizeInBytes, int minRowCount, int maxPageSizeInBytes, WorkProcessor<Page> pages, AggregatedMemoryContext memoryContext)
static WorkProcessor<Page>
mergePages(Iterable<? extends Type> types, long minPageSizeInBytes, int minRowCount, WorkProcessor<Page> pages, AggregatedMemoryContext memoryContext)
-
-
-
Method Detail
-
mergePages
public static WorkProcessor<Page> mergePages(Iterable<? extends Type> types, long minPageSizeInBytes, int minRowCount, WorkProcessor<Page> pages, AggregatedMemoryContext memoryContext)
-
mergePages
public static WorkProcessor<Page> mergePages(Iterable<? extends Type> types, long minPageSizeInBytes, int minRowCount, int maxPageSizeInBytes, WorkProcessor<Page> pages, AggregatedMemoryContext memoryContext)
-
-