US 12,481,674 B2
Query offloading in a computer system
Thomas Rech, Rittersheim (DE); Hans-Jürgen Zeltwanger, Weinsberg (DE); Dirk Nakott, Stuttgart (DE); Jens Peter Seifert, Gaertringen (DE); Martin Jungfer, Ostelsheim (DE); Holger Hellmuth, Bensheim (DE); Jörn Klauke, Petersberg (DE); and Alexander Zietlow, Sandhausen (DE)
Assigned to International Business Machines Corporation, Armonk, NY (US)
Filed by INTERNATIONAL BUSINESS MACHINES CORPORATION, Armonk, NY (US)
Filed on Mar. 3, 2022, as Appl. No. 17/653,315.
Prior Publication US 2023/0281218 A1, Sep. 7, 2023
Int. Cl. G06F 16/27 (2019.01); G06F 16/2458 (2019.01)
CPC G06F 16/27 (2019.01) [G06F 16/2471 (2019.01)] 16 Claims
OG exemplary drawing
 
1. A computer-implemented method comprising:
storing, to a primary database, metadata indicative of a computer system comprising (i) the primary database, configured to connect to a secondary database, and (ii) the secondary database that replicates the primary database;
receiving, at the primary database from a requestor, a query referencing data stored to the primary database;
determining a first load of a first value on the primary database;
responsive to the first load on the primary database failing to satisfy a first offload condition, initiating, by the primary database, execution of the query;
executing, by the primary database, a first subset of the query;
determining, dynamically during execution of the query and subsequent to successfully executing the first subset of the query, a change to the first load on the primary database, wherein the first value of the first load on the primary database has changed to a second value of the first load on the primary database;
responsive to the second value of the first load satisfying the first offload condition, determining, using the metadata, that a second load on the secondary database satisfies a second offload condition;
responsive to the second load satisfying the second offload condition:
offloading, during execution of the received query, a second subset of the query to the secondary database, wherein the second subset is a nonexecuted portion of the query; and
causing the secondary database to execute the second subset of the query; and
returning results of the query to the requestor, wherein the results include a result of the first subset of the query executed by the primary database and the second subset of the query executed by the secondary database.