Hybrid Sort Algorithm for Large Dataset Query Processing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing query processing engines are hindered by the slow performance of sort operations, which significantly impact the speed and cost of query execution, especially when dealing with large datasets and complex sort orders.
Innovation Solution
A hybrid sort algorithm is developed that combines multiple sort algorithms, such as MSB radix sort, TimSort, and merge sort with offset value codes, to adaptively optimize sorting based on the input data, thereby improving performance across various sort orders and data types.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If a single sort algorithm is used, then the sort operator is simple to implement, but the sorting speed is slow (2-5× slower than hybrid sort)
Solution Approach 1:
The patent combines multiple sort algorithms (radix sort, TimSort, merge sort with offset value codes) into a single hybrid sort operator that adapts to different input data characteristics. This merging of algorithms resolves the contradiction by achieving 2-5× faster sorting speeds while managing complexity through adaptive selection rather than exhaustive comparison of all algorithms.
Solution Approach 2:
The hybrid sort operator dynamically selects and switches between different sort algorithms based on the characteristics of the input data. This dynamic adaptation allows the system to optimize for speed in each specific case while maintaining a unified interface, resolving the contradiction between speed and complexity.
2Quantity of substance
If the dataset is large, then more data can be processed, but the sort operation becomes slower and more expensive
Solution Approach 1:
The patent divides large datasets into smaller subsets that can be sorted independently using the hybrid sort algorithm. This segmentation allows parallel processing and reduces the overhead of sorting entire large datasets at once, thereby maintaining high productivity even as dataset size increases.
Solution Approach 2:
The hybrid sort operator maintains continuous optimization by adapting to different data characteristics throughout the sorting process, ensuring that the most efficient algorithm is applied at each stage. This continuous adaptation prevents performance degradation as dataset size grows.
3Adaptability or versatility
If arbitrary sort orders are supported, then the sort operator is more versatile, but the sorting complexity increases
Solution Approach 1:
The hybrid sort operator is designed to handle arbitrary sort orders (ascending, descending, custom collations) through a unified interface. By incorporating multiple algorithms that can each handle diverse sort requirements, the system achieves universality without proportionally increasing complexity, as the adaptive selection mechanism manages the underlying complexity.
Data Source
AI summary
A system for multipass sort with subsplitting includes a communication interface and a processor. The communication interface is configured to receive from a client device a request to sort a dataset that includes a plurality of rows, where the size of the dataset is greater than a threshold size. The processor is configured to: subdivide the dataset into a plurality of data subsets; sort each of the plurality of data subsets; merge the plurality of sorted data subsets utilizing a binary merge tree to generate a sorted dataset; and provide the sorted dataset to the client device.


