US 12,455,880 B2
Intelligent optimization of parameterized queries
Taehyung Lee, Seoul (KR); Taeyoung Jeong, Seoul (KR); Taehun Kim, Seoul (KR); Sungwon Kim, Seoul (KR); and Sanghee Lee, Seoul (KR)
Assigned to SAP SE, Walldorf (DE)
Filed by SAP SE, Walldorf (DE)
Filed on Dec. 6, 2022, as Appl. No. 18/075,781.
Claims priority of provisional application 63/405,711, filed on Sep. 12, 2022.
Prior Publication US 2024/0086404 A1, Mar. 14, 2024
Int. Cl. G06F 16/2453 (2019.01)
CPC G06F 16/2454 (2019.01) [G06F 16/24542 (2019.01)] 18 Claims
OG exemplary drawing
 
1. A computer-implemented method for improving efficiency of parameterized query optimization, the method comprising:
receiving a parameterized query written in a declarative language, wherein the parameterized query comprises a placeholder which can be assigned different values when the parameterized query is executed;
generating a first query plan, wherein generating the first query plan comprises performing a first compilation session of the parameterized query in which the placeholder has no assigned value, wherein performing the first compilation session comprises:
generating an intermediate representation of the parameterized query, wherein the intermediate representation describes a relational algebra expression to implement the parameterized query; and
generating the first query plan based on the intermediate representation;
serializing the intermediate representation into an abstract query plan; and
generating a second query plan different from the first query plan, wherein generating the second query plan comprises performing a second compilation session of the parameterized query in which the placeholder has an assigned value, wherein performing the second compilation session comprises:
providing the abstract query plan and the assigned value as input to the second compilation session;
deserializing the abstract query plan into the intermediate representation; and
reusing the intermediate representation to generate the second query plan; and
executing the parameterized query using the second query plan.