K-means Clustering Database Queries Runtime Prediction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for clustering queries in databases are limited as they either do not produce optimal K-means clustering or are too slow, failing to efficiently predict query runtime for effective workload management and query scheduling.
Innovation Solution
A computer-implemented method using a linear-time Row Minima Searching algorithm to compute the optimal K-means clustering of query runtimes, allowing for fast and accurate clustering of reference queries for predicting the runtime of target queries based on similarity.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If existing clustering methods are used for query runtime prediction, then clustering can be performed, but the methods are too slow and do not produce optimal K-means clustering
Solution Approach 1:
The patent transforms the K-means clustering problem into a dynamic programming problem by changing the computational parameters and approach. It defines a cost function based on squared Euclidean distances and uses dynamic programming recurrence relations to compute optimal cluster assignments, achieving both optimal clustering accuracy and improved computational efficiency compared to traditional K-means iterative methods
Solution Approach 2:
The patent replaces the mechanical iterative optimization process of traditional K-means clustering with a systematic dynamic programming approach. Instead of repeatedly updating centroids and reassigning points until convergence, the method uses a structured computation with defined recurrence relations and bottom-up evaluation to directly determine optimal clustering, substituting the iterative mechanical process with a more efficient algorithmic system
2Measurement precision
If optimal K-means clustering is computed using traditional methods, then accurate clustering is achieved, but the computation is too slow for practical query scheduling
Solution Approach 1:
The patent segments the clustering computation into distinct phases: preprocessing to compute pairwise distances, dynamic programming to determine optimal cluster boundaries, and postprocessing to assign cluster labels. This segmentation allows each phase to be optimized independently and enables efficient computation of what would otherwise be an intractable optimization problem
Solution Approach 2:
The patent performs preliminary computations of pairwise squared Euclidean distances between all query points and cluster centroids before executing the main clustering algorithm. This preprocessing step stores distance information that is reused throughout the dynamic programming computation, avoiding redundant distance calculations and significantly improving computational efficiency
Data Source
AI summary
The invention notably relates to a computer-implemented method of clustering reference queries in a database for prediction of the runtime of a target query in the database based on similarity of the target query with the reference queries. The method comprises providing a number of numerical values that represent the runtimes of the reference queries; computing the optimal K-means clustering of the numerical values for a predetermined number of clusters, wherein the computing includes iterating, a number of times corresponding to the predetermined number of clusters, a linear-time Row Minima Searching algorithm applied to a square matrix of order equal to the number of numerical values; and clustering the reference queries according to the computed clustering of the numerical values.Such a method improves the field of database query runtime prediction.

