Scraper Sort Hardware Acceleration for Early Database Result Return
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing database sorting mechanisms require full data sorting before any results can be returned, which is inefficient for queries that only need the first L results, especially when index overhead is high and query ordering is not reused.
Innovation Solution
A hardware-assisted sort procedure, known as scraper sort, using specialized hardware like ASICs, FPGAs, or GPUs, allows for early return of up to K results with a single pass over the data, employing modified parallel sort algorithms to produce a fully-sorted subset and locally-sorted subsets, reducing computation cost and enabling early result transmission.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If full data sorting is performed before returning results, then sorting completeness is ensured, but processing time is increased
Solution Approach 1:
The patent extracts only the necessary portion of sorted data (first L results) from the full sorting process. By using a selection buffer and early termination mechanism, the system extracts the required results before completing the entire sort operation, thereby reducing sorting time while maintaining result accuracy for the requested portion.
Solution Approach 2:
The patent applies partial action by performing only enough sorting work to obtain the first L results rather than sorting the entire dataset. The selection buffer tracks the top L elements seen so far, allowing the system to stop processing once these L elements are identified and sorted, avoiding unnecessary computation on remaining elements.
2Productivity
If hardware-assisted sorting is implemented, then sorting speed is increased, but device complexity is increased
Solution Approach 1:
The patent introduces a selection buffer as an intermediary data structure between the input data stream and the final output. This buffer acts as a mediator that maintains the top L elements in sorted order while new elements arrive, allowing the system to achieve partial sorting results without implementing complex hardware sorting networks. The buffer serves as a simple, efficient intermediary that reduces overall system complexity.
3Loss of time
If early return of partial results is enabled, then processing time is reduced, but data completeness is reduced
Solution Approach 1:
The patent extracts exactly the required amount of data (first L results) from the processing stream and returns them immediately. The selection buffer mechanism ensures that only the necessary L elements are retained and processed, while other elements are discarded without full sorting. This extraction approach delivers complete results for the requested portion while avoiding processing of unnecessary additional data.
Data Source
AI summary
As described herein, a database machine is provided with specialized hardware that can be used to accelerate the sort function. This hardware lowers the computation cost of performing a raw sort operation over the result rows. The hardware may be embodied in a direct circuit (e.g., ASIC), a programmable circuit (e.g., FPGA), a parallel compute engine (e.g., GPU) or any parallel computer. A hardware-assisted sort procedure provides for the early return of up to K results. This early return feature is critically valuable in database operations because often an entire result set is not required. For requests that require only the first L results, when L<=K the query can be satisfied with only a single pass over the data. The hardware- or GPU-assisted sort procedure, referred to herein as “scraper sort,” may be based on modifications of well-known, existing parallel sort algorithms.


