US 12,405,951 B2
Custom replacement of functions with inverse functions for improved query performance
Heiko Gerwens, Heidelberg (DE); and Johannes Merx, Heidelberg (DE)
Assigned to SAP SE, Walldorf (DE)
Filed by SAP SE, Walldorf (DE)
Filed on Jun. 16, 2023, as Appl. No. 18/211,185.
Prior Publication US 2024/0419664 A1, Dec. 19, 2024
Int. Cl. G06F 16/21 (2019.01); G06F 16/2453 (2019.01)
CPC G06F 16/24542 (2019.01) [G06F 16/217 (2019.01)] 20 Claims
OG exemplary drawing
 
1. A computing system comprising:
at least one memory;
one or more hardware processor units coupled to the at least one memory; and
one or more computer readable storage media storing computer-executable instructions that, when executed, cause the computing system to perform operations comprising:
receiving a function definition of a function;
receiving from a client an inverse function definition of an inverse function, wherein the inverse function is an inverse function of the function;
receiving a query, the query comprising a call for the function;
determining that the inverse function is available for the function; and
preparing a query execution plan that comprises the inverse function in place of the function, wherein preparing the query execution plan comprises a rewritten predicate in which the inverse function is applied to a value specified in the query; and
executing the query execution plan, the executing comprising:
(1) applying the inverse function to the value specified in the query, wherein execution of the query comprises accessing an index for a database column using an output of the inverse function when applied to the value specified in the query, or
(2) applying the inverse function to the value specified in the query, wherein execution of the query does not apply the function to values of a database column for comparison to the value specified in the query.