US 12,321,347 B1
Query performance improvement of a query for a database application using rewrite
Sheng Yan Sun, Beijing (CN); Xu Qin Zhao, Beijing (CN); Si Er Han, Xi'an (CN); Xue Ying Zhang, Xi'an (CN); and Xiao Ming Ma, Xi'an (CN)
Assigned to International Business Machines Corporation, Armonk, NY (US)
Filed by International Business Machines Corporation, Armonk, NY (US)
Filed on Mar. 29, 2024, as Appl. No. 18/621,385.
Int. Cl. G06F 16/2453 (2019.01); G06F 11/34 (2006.01)
CPC G06F 16/24534 (2019.01) [G06F 11/3409 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A method for improving a query performance of a query of a database application using rewrite, the method comprising:
introducing a database query into a database application executed by a computer system to obtain a query result;
analyzing, by the computer system, the database query to identify index columns and a predicate column;
identifying, by the computer system, associated columns by determining if any associations exist between the index columns and the predicate column;
calculating, by the computer system, a confidence score value for each associated column of the associated columns responsive to the associated columns and the predicate column;
generating, by the computer system, a list of the associated columns with the confidence score values;
automatically, by the computer system, generating a rewritten query by rewriting the database query based on the list of the associated columns and the confidence score values;
validating the rewritten query by running the rewritten query on a module of the computer system to determine if a rewritten query result has a better performance than the query result; and
executing, by the computer system, the validated rewritten query by the database application to obtain an updated query result including retrieved data from a storage device.