IP Library Granted Patent US 12,481,674
Granted Patent B2
US 12,481,674 · App. 17/653,315 · Granted Nov 25, 2025

Query offloading in a computer system

Inventors: 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); Alexander Zietlow (Sandhausen, DE)
Assignee: International Business Machines Corporation
G06F16/27G06F16/2471
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,481,674
App. No.
17/653,315
Granted
Nov 25, 2025
Kind
B2
Abstract

An approach includes collecting metadata indicative of a computer system comprising (i) a primary database, configured to connect to a secondary database, and (ii) the secondary database that replicates the primary database. The approach further includes receiving, at the primary database from a requestor, a query referencing the primary database. The approach further includes, responsive to receiving the query, performing an offload including: determining a first load on the primary database; responsive to the first load satisfying a first offload condition, determining, using the metadata, whether a second load on the secondary database satisfies a second offload condition; and responsive to the second load satisfying the second offload condition, offloading at least part of the query to the secondary database in order to cause the at least part of the query to be executed by the secondary database. The method further includes providing to the requestor results of the query.

Claims (58)

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.

2 . The computer-implemented method of claim 1 , the first load comprising a selection from the group consisting of: central processing unit (CPU) utilization of the primary database, execution queue length at the primary database, and number of records of the query; and

wherein the first offload condition requires that at least one of the values exceeds a respective threshold.

3 . The computer-implemented method of claim 1 , the second load comprising a selection from the group consisting of: central processing unit (CPU) utilization, execution queue length, and number of records of the query; and

wherein the second offload condition requires that at least one of the values exceeds a respective threshold.

4 . The computer-implemented method of claim 1 , wherein the first offload condition is the second offload condition.

5 . The computer-implemented method of claim 3 , wherein the first offload condition is different from the second offload condition.

6 . The computer-implemented method of claim 1 , the first offload condition further requiring that the received query is a read-only query.

7 . The computer-implemented method of claim 1 , the metadata comprising connection information of the connection to the secondary database, and status information of the secondary database, the status information comprising a selection from the group consisting of: last applied transaction and execution queue length.

8 . The computer-implemented method of claim 1 , wherein the metadata is updated upon an occurrence of a selection of the group consisting of: start-up of the primary database, start-up of the secondary database, and changing data in the secondary database.

9 . The computer-implemented method of claim 7 , wherein the connection information is updated upon start-up of the primary database and the status information is updated upon start-up of the secondary database.

10 . The computer-implemented method of claim 1 , comprising storing the metadata in non-persistent storage.

11 . The computer-implemented method of claim 1 , further comprising: determining, using the metadata, that a copy of data of the primary database that is referenced by the query is present in the secondary database, wherein the offloading is performed in response to the copy of the data being present in the secondary database.

12 . A computer program product comprising:

one or more computer readable storage media; and

program instructions stored on the one or more computer readable storage media to perform operations 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.

13 . The computer program product of claim 12 , the first load comprising a selection from the group consisting of: central processing unit (CPU) utilization of the primary database, execution queue length at the primary database, and number of records of the query; and

wherein the first offload condition requires that at least one of the values exceeds a respective threshold.

14 . The computer program product of claim 12 , the second load comprising a selection from the group consisting of: central processing unit (CPU) utilization, execution queue length, and number of records of the query; and

wherein the second offload condition requires that at least one of the values exceeds a respective threshold.

15 . The computer program product of claim 12 , wherein the first offload condition is the second offload condition.

16 . A computer system comprising:

a processor set;

one or more computer readable storage media; and

program instructions stored on the one or more computer readable storage media to cause the processor set to perform operations 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.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 3, 2022
From: RECH, THOMAS; ZELTWANGER, HANS-JÜRGEN; NAKOTT, DIRK; SEIFERT, JENS PETER; JUNGFER, MARTIN; HELLMUTH, HOLGER; KLAUKE, JÖRN; ZIETLOW, ALEXANDER
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 059157/0707 →
Continuity (1)
Related Publication 20230281218A1 · Sep 7, 2023
References Cited (18)
US 7734580B2 · Lahiri · 2010 [cited by applicant]
US 10268704B1 · Sanderson · 2019 [cited by examiner]
US 10698882B2 · Parikh · 2020 [cited by applicant]
US 20180150368A1 · Lee · 2018 [cited by applicant]
US 20180157710A1 · Guirguis · 2018 [cited by examiner]
US 20180278685A1 · Tiwari · 2018 [cited by applicant]
US 20190079841A1 · Lee · 2019 [cited by applicant]
US 20190392067A1 · Sonawane · 2019 [cited by applicant]
US 20200034055A1 · Aron · 2020 [cited by applicant]
US 20200097593A1 · Chen · 2020 [cited by applicant]
US 20210303572A1 · Ouyang · 2021 [cited by applicant]
US 20220179859A1 · Faltin · 2022 [cited by examiner]
US 20220300380A1 · Beier · 2022 [cited by examiner]
CN 110196859A · 2019 [cited by applicant]
WO 2023166373A1 · 2023 [cited by applicant]
Huaming Wu; Multi-Objective Decision-Making for Mobile Cloud Offloading: A Survey; 2017; IEEE; pp. 1-15 (Year: 2017). [cited by examiner]
International Searching Authority, “Written Opinion of the International Searching Authority”, International application No. PCT/IB2023/051398, International Filing Date Feb. 16, 2023, Mailed on Jun. 19, 2023, 8 pages. [cited by applicant]
“Database Load Balancing for MySQL and MariaDB with ProxySQL”, Several Nines, Printed Mar. 3, 2022, 20 pages, <https://severalnines.com/resources/tutorials/proxysql-tutorial-mysql-mariadb >. [cited by applicant]