Terminal Database Parallel Query Partitioning by CPU Frequency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Intelligent terminal databases face challenges in utilizing multiple CPU cores efficiently due to the presence of both big and little cores, leading to suboptimal parallel execution performance, especially in scenarios where SQL statement execution durations are short, affecting user experience.
Innovation Solution
A method and apparatus that dynamically divide a data table into partitions based on the frequency proportion of thread CPUs, allowing each thread CPU to query a corresponding data partition, thereby optimizing data query efficiency by ensuring that higher frequency CPUs handle larger data loads and lower frequency CPUs handle smaller loads.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If data is equally allocated to each CPU core, then task distribution is simple, but execution efficiency decreases due to frequency differences between big and little cores
Solution Approach 1:
The patent applies local quality by allocating different amounts of data to different CPU cores based on their specific frequency characteristics. High-frequency big cores receive larger data partitions while low-frequency little cores receive smaller partitions, optimizing overall execution efficiency by matching task load to processing capability.
Solution Approach 2:
The patent changes the parameter of data allocation from equal distribution to frequency-proportional distribution. By calculating frequency proportions of available CPU cores and allocating data partitions accordingly, the system adapts to heterogeneous core performance and improves parallel query execution efficiency.
2Ease of manufacture
If conventional equal data allocation is used, then implementation is straightforward, but big cores wait for little cores causing reduced overall efficiency
Solution Approach 1:
The patent changes the allocation parameter from uniform distribution to frequency-proportional distribution. By calculating the frequency proportion of each CPU core and allocating data partitions accordingly, the system ensures that big cores complete their tasks faster and don't need to wait for little cores, reducing overall execution time.
3Use of energy by moving object
If CPU frequency is limited, then power consumption is reduced, but execution duration of SQL statements greatly increases
Solution Approach 1:
The patent applies dynamics by dynamically selecting and allocating CPU cores based on their frequency characteristics and availability. The system can adaptively choose which cores to use and how to distribute data partitions, optimizing the balance between power consumption and execution duration for database queries.
Data Source
AI summary
A parallel execution method and apparatus in a terminal database, where the method includes determining, by a terminal, each thread central processing unit (CPU) based on a preset degree of parallelism, where the degree of parallelism is a quantity of threads executed in parallel, obtaining, by the terminal, a frequency of each thread CPU, calculating a frequency proportion of the thread CPUs, dividing, by the terminal, a to-be-queried data table in the terminal database into data partitions based on the frequency proportion of the thread CPUs, determining a data partition corresponding to each thread CPU, and querying in parallel, by the terminal, data in the corresponding data partition using each thread CPU.


