← Back to Patent Explorer
US7089228B2 Expired / Lapsed US ⏱️ 0.0 years remaining

Computer apparatus and method for caching results of a database query

Assignee: International Business Machines Corp
•
Filing: 2002-04-18
•
Granted: 2006-08-08
•
Expires: 2022-04-18
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract A query processor caches data retrieved from executing prepared statements, and uses the cached data for subsequent accesses to the data, if certain conditions for using the cached data are met. The preferred embodiments also include a data staleness handler that takes care of issues that arise from data that may have changed in the database but is not reflected in the cache. One way to handle data staleness in the cache is to specifically enable or disable caching in a query. If caching is disabled, the query processor will access the data in the database. Another way to handle data staleness in the cache is to provide a timer that causes the cache to be invalidated when the timer times out. Yet another way to handle data staleness in the cache is to provide specified conditions that must be met for caching to occur, such as time or date limitations. Still another way to handle data staleness in the cache is to provide an update trigger for the data in the database that corresponds to the cached data. When the data in the database is updated, the update trigger fires, causing the cache to be invalidated. Note that invalidating the cache could also be followed by automatically updating the cache. By caching the results of processing a prepared statement, other queries that use the same prepared statement may be able to access data in the cache instead of going to the database.

Inventors

  • 👤 Jeremy Alan Arnold
  • 👤 Eric Lawrence Barsness
  • 👤 Richard Dean Dettinger
  • 👤 John Matthew Santosuosso

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-11-06 03:45
CPC Classifications
G; G06; G06F; G06F16/00; G06F16/20; G06F16/24; G06F16/245; G06F16/2455; G06F16/24552; Y; Y10; Y10S; Y10S707/00; Y10S707/99931; Y10S707/99933; Y10S707/99941; Y10S707/99944; Y10S707/99945; Y10S707/99951; Y10S707/99952; Y10S707/99953

Claims Analysis

Total Claims: 39
Claim 1
Independent Claim 143 words
An apparatus comprising: at least one processor; a memory coupled to the at least one processor; a database residing in the memory; a query processor residing in the memory and executed by the at least one processor, the query processor caching data retrieved from the database as a result of a first query, and returning cached data when processing a second query to the database instead of accessing data in the database; and a data staleness handler that determines from a specified parameter in the second query whether use of cached data is enabled when processing the second query and does not return the cached data when processing the second query if a specified range of values for using the cached data is not satisfied or if the specified parameter specifies that use of cached data is disabled when processing the second query.
Claim 2
Independent Claim 143 words
An apparatus comprising: at least one processor; a memory coupled to the at least one processor; a database residing in the memory; a query processor residing in the memory and executed by the at least one processor, the query processor caching data retrieved from the database as a result of a first query, and returning cached data when processing a second query to the database instead of accessing data in the database; and a data staleness handler that determines from a specified parameter in the second query whether use of cached data is enabled when processing the second query and does not return the cached data when processing the second query if a specified range of values for using the cached data is not satisfied or if the specified parameter specifies that use of cached data is disabled when processing the second query.
Claim 3
Dependent Claim 54 words
The apparatus of claim 1 wherein the first query comprises a prepared statement having a first specified value, and wherein the second query comprises the prepared statement having a second specified value, wherein the second query is capable of being satisfied by data retrieved from the database during the processing of the first query.
Claim 4
Dependent Claim 26 words
The apparatus of claim 1 wherein the specified range of values comprises a range of times during which use of the cached data is not allowed.
Claim 5
Dependent Claim 26 words
The apparatus of claim 1 wherein the specified range of values comprises a range of dates during which use of the cached data is not allowed.
Claim 6
Dependent Claim 41 words
The apparatus of claim 1 wherein the data staleness handler monitors selected data in the database that corresponds to at least a portion of the cached data, and that invalidates the cached data when the selected data in the database changes.
Claim 7
Dependent Claim 28 words
The apparatus of claim 5 wherein the data staleness handler updates the cached data by retrieving the changed data from the database when the cached data is invalidated.
Claim 8
Dependent Claim 23 words
The apparatus of claim 1 wherein the data staleness handler uses a timer to invalidate the cached data when the timer times out.
Claim 9
Dependent Claim 28 words
The apparatus of claim 7 wherein the data staleness handler updates the cached data by retrieving the changed data from the database when the cached data is invalidated.
Claim 10
Dependent Claim 23 words
The apparatus of claim 7 wherein the query processor may bypass the cached data and return data from the database under specified conditions.
Claim 11
Independent Claim 285 words
An apparatus comprising: at least one processor; a memory coupled to the at least one processor; a database residing in the memory; a cache residing in the memory; a query processor residing in the memory and executed by the at least one processor, the query processor storing data retrieved from the database into the cache as a result of a first query, and returning data from the cache when processing a second query to the database instead of accessing the data in the database if specified conditions for returning the cached data are satisfied; a data staleness handler residing in the memory and executed by the at least one processor, wherein the data staleness handler indicates to the query processor when the cached data cannot be returned, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned when processing the second query if use of cached data is disabled in the second query, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned during a specified range of times, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned during a specified range of dates, wherein the data staleness handler monitors selected data in the database that corresponds to at least a portion of the cached data and invalidates the cached data when the selected data in the database changes, wherein the data staleness handler uses a timer to invalidate the cached data when the timer times out, wherein the data staleness handler updates the cached data by retrieving the changed data from the database into the cache when the cached data is invalidated.
Claim 12
Independent Claim 285 words
An apparatus comprising: at least one processor; a memory coupled to the at least one processor; a database residing in the memory; a cache residing in the memory; a query processor residing in the memory and executed by the at least one processor, the query processor storing data retrieved from the database into the cache as a result of a first query, and returning data from the cache when processing a second query to the database instead of accessing the data in the database if specified conditions for returning the cached data are satisfied; a data staleness handler residing in the memory and executed by the at least one processor, wherein the data staleness handler indicates to the query processor when the cached data cannot be returned, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned when processing the second query if use of cached data is disabled in the second query, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned during a specified range of times, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned during a specified range of dates, wherein the data staleness handler monitors selected data in the database that corresponds to at least a portion of the cached data and invalidates the cached data when the selected data in the database changes, wherein the data staleness handler uses a timer to invalidate the cached data when the timer times out, wherein the data staleness handler updates the cached data by retrieving the changed data from the database into the cache when the cached data is invalidated.
Claim 13
Dependent Claim 237 words
A computer-implemented method for processing a second query to a database, the method comprising the steps of (A) processing a first query to the database by performing the steps of (A1) retrieving data from the database that satisfies the first query; (A2) storing the retrieved data in a cache; and (A3) returning the retrieved data; (B) processing the second query by performing the steps of (B1) determining from a specified parameter in the second query whether use of cached data is allowed in processing the second query: (B2) determining whether the second query is capable of being satisfied by data stored in the cache; (B3) determining whether use of cached data is allowed depending on whether a specified range of values for using the cache is satisfied; (B4) if the query is capable of being satisfied by data stored in the cache and the use of cached data is allowed, retrieving data from the cache that satisfies the second query, and returning the data retrieved from the cache; (B5) if the query is not capable of being satisfied by data stored in the cache, retrieving data from the database that satisfies the second query, and returning the data that satisfies the second query; (B6) if the use of cached data is not allowed as determined instep (B1), retrieving data from the database that satisfies the second query, and returning the retrieved data that satisfies the second query.
Claim 14
Dependent Claim 237 words
A computer-implemented method for processing a second query to a database, the method comprising the steps of (A) processing a first query to the database by performing the steps of (A1) retrieving data from the database that satisfies the first query; (A2) storing the retrieved data in a cache; and (A3) returning the retrieved data; (B) processing the second query by performing the steps of (B1) determining from a specified parameter in the second query whether use of cached data is allowed in processing the second query: (B2) determining whether the second query is capable of being satisfied by data stored in the cache; (B3) determining whether use of cached data is allowed depending on whether a specified range of values for using the cache is satisfied; (B4) if the query is capable of being satisfied by data stored in the cache and the use of cached data is allowed, retrieving data from the cache that satisfies the second query, and returning the data retrieved from the cache; (B5) if the query is not capable of being satisfied by data stored in the cache, retrieving data from the database that satisfies the second query, and returning the data that satisfies the second query; (B6) if the use of cached data is not allowed as determined instep (B1), retrieving data from the database that satisfies the second query, and returning the retrieved data that satisfies the second query.
Claim 15
Dependent Claim 26 words
The method of claim 11 wherein the specified range of values comprises a range of times during which use of the cached data is not allowed.
Claim 16
Dependent Claim 26 words
The method of claim 11 wherein the specified range of values comprises a range of dates during which use of the cached data is not allowed.
Claim 17
Dependent Claim 33 words
The method of claim 11 further comprising the steps of: monitoring data in the database that corresponds to cached data; and invalidating the cached data when the corresponding data in the database changes.
Claim 18
Dependent Claim 31 words
The method of claim 14 further comprising the step of updating the cached data by retrieving the changed data from the database into the cache when the cached data is invalidated.
Claim 19
Dependent Claim 19 words
The method of claim 11 further comprising the step of invalidating the cached data when a timer times out.
Claim 20
Dependent Claim 31 words
The method of claim 16 further comprising the step of updating the cached data by retrieving the changed data from the database into the cache when the cached data is invalidated.
Claim 21
Dependent Claim 24 words
The method of claim 16 further comprising the step of bypassing the cached data and retrieving the data from the database under specified conditions.
Claim 22
Dependent Claim 293 words
A computer-implemented method for processing a second query to a database, the method comprising the steps of: (A) processing a first query to the database by performing the steps of: (A1) retrieving data from the database that satisfies the first query; (A2) storing the retrieved data in a cache; and (A3) returning the retrieved data; (B) processing the second query by performing the steps of: (B1) determining whether the second query is capable of being satisfied by data stored in the cache; (B2) determining whether caching is disabled in the second query; (B3) determining whether the second query specifies a range of times during which use of the cached data is not allowed; (B4) determining whether the second query specifies a range of dates during which use of the cached data is not allowed; (B5) if the query is capable of being satisfied by data stored in the cache, if step (B2) indicates that caching is not disabled, and if steps (B3) and (B4) indicate that use of the cached data is allowed, retrieving the data from the cache that satisfies the second query and returning the data that satisfies the second query; (B6) if the query is not capable of being satisfied by data stored in the cache, retrieving data from the database that satisfies the second query, and returning the data that satisfies the second query; (B7) if step (B2) indicates that caching is disabled in the second query, retrieving data from the database that satisfies the second query, and returning the retrieved data that satisfies the second query; and (B8) if either of steps (B3) and (B4) indicate that use of the cached data is not allowed, retrieving data from the database and returning the data retrieved from the database.
Claim 23
Dependent Claim 293 words
A computer-implemented method for processing a second query to a database, the method comprising the steps of: (A) processing a first query to the database by performing the steps of: (A1) retrieving data from the database that satisfies the first query; (A2) storing the retrieved data in a cache; and (A3) returning the retrieved data; (B) processing the second query by performing the steps of: (B1) determining whether the second query is capable of being satisfied by data stored in the cache; (B2) determining whether caching is disabled in the second query; (B3) determining whether the second query specifies a range of times during which use of the cached data is not allowed; (B4) determining whether the second query specifies a range of dates during which use of the cached data is not allowed; (B5) if the query is capable of being satisfied by data stored in the cache, if step (B2) indicates that caching is not disabled, and if steps (B3) and (B4) indicate that use of the cached data is allowed, retrieving the data from the cache that satisfies the second query and returning the data that satisfies the second query; (B6) if the query is not capable of being satisfied by data stored in the cache, retrieving data from the database that satisfies the second query, and returning the data that satisfies the second query; (B7) if step (B2) indicates that caching is disabled in the second query, retrieving data from the database that satisfies the second query, and returning the retrieved data that satisfies the second query; and (B8) if either of steps (B3) and (B4) indicate that use of the cached data is not allowed, retrieving data from the database and returning the data retrieved from the database.
Claim 24
Dependent Claim 33 words
The method of claim 19 further comprising the steps of: monitoring data in the database that corresponds to cached data; and invalidating the cached data when the corresponding data in the database changes.
Claim 25
Dependent Claim 31 words
The method of claim 20 further comprising the step of updating the cached data by retrieving the changed data from the database into the cache when the cached data is invalidated.
Claim 26
Dependent Claim 19 words
The method of claim 19 further comprising the step of invalidating the cached data when a timer times out.
Claim 27
Dependent Claim 31 words
The method of claim 22 further comprising the step of updating the cached data by retrieving the changed data from the database into the cache when the cached data is invalidated.
Claim 28
Dependent Claim 127 words
A program product comprising: (A) a query processor that caches data retrieved from a database as a result of a first query, and returns cached data when processing a second query to the database instead of accessing data in the database wherein the query processor includes a data staleness handler that determines from a specified parameter in the second query whether use of cached data is enabled when processing the second query and does not return the cached data when processing the second query if a specified range of values for using the cached data is not satisfied or if the specified parameter specifies that use of cached data is disabled when processing the second query; and (B) recordable computer-readable signal bearing media bearing the query processor.
Claim 29
Dependent Claim 127 words
A program product comprising: (A) a query processor that caches data retrieved from a database as a result of a first query, and returns cached data when processing a second query to the database instead of accessing data in the database wherein the query processor includes a data staleness handler that determines from a specified parameter in the second query whether use of cached data is enabled when processing the second query and does not return the cached data when processing the second query if a specified range of values for using the cached data is not satisfied or if the specified parameter specifies that use of cached data is disabled when processing the second query; and (B) recordable computer-readable signal bearing media bearing the query processor.
Claim 30
Dependent Claim 53 words
The program product of claim 24 wherein the first query comprises a prepared statement having a first specified value, and wherein the second query comprises the prepared statement having a second specified value, wherein the second query may be satisfied by data retrieved from the database during the processing of the first query.
Claim 31
Dependent Claim 27 words
The program product of claim 24 wherein the specified range of values comprises a range of times during which use of the cached data is not allowed.
Claim 32
Dependent Claim 27 words
The program product of claim 24 wherein the specified range of values comprises a range of dates during which use of the cached data is not allowed.
Claim 33
Dependent Claim 42 words
The program product of claim 24 wherein the data staleness handler monitors selected data in the database that corresponds to at least a portion of the cached data, and that invalidates the cached data when the selected data in the database changes.
Claim 34
Dependent Claim 29 words
The program product of claim 28 wherein the data staleness handler updates the cached data by retrieving the changed data from the database when the cached data is invalidated.
Claim 35
Dependent Claim 24 words
The program product of claim 24 wherein the data staleness handler uses a timer to invalidate the cached data when the timer times out.
Claim 36
Dependent Claim 29 words
The program product of claim 30 wherein the data staleness handler updates the cached data by retrieving the changed data from the database when the cached data is invalidated.
Claim 37
Dependent Claim 24 words
The program product of claim 24 wherein the query processor may bypass the cached data and return data from the database under specified conditions.
Claim 38
Dependent Claim 248 words
A program product comprising: (A) a query that stores data retrieved from a database into a cache as a result of a first query, and returns data from the cache when processing a second query to the database instead of accessing the data in the database if specified conditions for returning the cached data are satisfied; (B) a data staleness handler that indicates to the query processor when the cached data cannot be returned, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned when processing the second query if use of cached data is disabled in the second query, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned during a specified range of times, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned during a specified range of dates, wherein the data staleness handler monitors selected data in the database that corresponds to at least a portion of the cached data and invalidates the cached data when the selected data in the database changes, wherein the data staleness handler uses a timer to invalidate the cached data when the timer times out, wherein the data staleness handler updates the cached data by retrieving the changed data from the database into the cache when the cached data is invalidated; and (C) recordable computer-readable signal bearing media bearing the query processor and the data staleness handler.
Claim 39
Dependent Claim 248 words
A program product comprising: (A) a query that stores data retrieved from a database into a cache as a result of a first query, and returns data from the cache when processing a second query to the database instead of accessing the data in the database if specified conditions for returning the cached data are satisfied; (B) a data staleness handler that indicates to the query processor when the cached data cannot be returned, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned when processing the second query if use of cached data is disabled in the second query, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned during a specified range of times, wherein the data staleness handler indicates to the query processor that the cached data cannot be returned during a specified range of dates, wherein the data staleness handler monitors selected data in the database that corresponds to at least a portion of the cached data and invalidates the cached data when the selected data in the database changes, wherein the data staleness handler uses a timer to invalidate the cached data when the timer times out, wherein the data staleness handler updates the cached data by retrieving the changed data from the database into the cache when the cached data is invalidated; and (C) recordable computer-readable signal bearing media bearing the query processor and the data staleness handler.

References Cited (Backward Citations)

US6578113B2 Cited
US6826557B1 Cited
US20020143855A1 Cited
US6941310B2 Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 2009-08-07 2010-02-06 2010-08-08 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 2013-08-07 2014-02-06 2014-08-08 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2017-08-07 2018-02-06 2018-08-08 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag