Class PooledTopNAlgorithm

All Implemented Interfaces:
TopNAlgorithm<int[],PooledTopNAlgorithm.PooledTopNParams>

public class PooledTopNAlgorithm extends BaseTopNAlgorithm<int[],BufferAggregator[],PooledTopNAlgorithm.PooledTopNParams>
This TopNAlgorithm is highly specialized for processing aggregates on string columns that are ColumnCapabilities.isDictionaryEncoded() and ColumnCapabilities.areDictionaryValuesUnique(). This algorithm is built around using a direct ByteBuffer from the 'processing pool' of intermediary results buffers, to aggregate using the dictionary id directly as the key, to defer looking up the value until is necessary. At runtime, this implementation is specialized with wizardry to optimize for processing common top-n query shapes, see computeSpecializedScanAndAggregateImplementations(), Generic1AggPooledTopNScanner and Generic1AggPooledTopNScannerPrototype, Generic2AggPooledTopNScanner and Generic2AggPooledTopNScannerPrototype, CalledFromHotLoop, HotLoopCallee, RuntimeShapeInspector for more details.