IP Library Granted Patent US 9,910,892
Granted Patent B2
US 9,910,892 · App. 12/242,637 · Granted Mar 6, 2018

Managing execution of database queries

Inventors: Stefan Krompass (Garching, DE); Harumi Anne Kuno (Cupertino, CA); Umeshwar Dayal (Saratoga, CA); Janet Lynn Wiener (Palo Alto, CA); Raja Sambasivan (Ossining, NY)
Assignee: Hewlett Packard Enterprise Development LP
G06F17/30463
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 9,910,892
App. No.
12/242,637
Granted
Mar 6, 2018
Kind
B2
Abstract

One embodiment is a method to manage queries in a database. The method identifies a query that executes on the database for an elapsed time that is greater than a threshold and then implements a remedial action when the query executes on the database for an execution time that is greater than an estimated execution time.

Claims (44)

1. A method comprising:

distinguishing between different types of long-running queries executing in a database system comprising a computer using a taxonomy of query performance problems, the taxonomy comprising a threshold, an estimated execution time calculated by a query optimizer for a query, an actual execution time of a query, and an elapsed time, wherein distinguishing between the different types of long-running queries using the taxonomy comprises:

identifying a respective query as a long-running query in response to an elapsed time for the respective query exceeding the threshold,

identifying a first long-running query of the long-running queries as a first type long-running query responsive to determining that an actual execution time of the first long-running query is less than an estimated execution time calculated by the query optimizer for the first long-running query and is less than an elapsed time of the first long-running query but greater than a specified time that is below the elapsed time of the first long-running query, and

identifying a second long-running query of the long-running queries as a second, different type long-running query responsive to determining that an actual execution time of the second long-running query is greater than an estimated execution time calculated by the query optimizer for the second long-running query and is less than a specified time that is below an elapsed time of the second long-running query;

implementing, by the database system, a remedial action for at least one of the long-running queries.

2. The method of claim 1 , wherein the remedial action comprises aborting execution of a long-running query of the different types of long-running queries.

3. The method of claim 1 , wherein implementing the remedial action comprises:

implementing a different remedial action for each of the different types of long-running queries.

4. The method of claim 1 wherein the different types of long-running queries comprise hog queries, runaway queries, starving queries, and buggy queries.

5. The method of claim 1 , wherein the second type long-running query is identified as a buggy long-running query responsive to determining that at least one other long-running query of the first type long-running query is currently executing in the database system, and

wherein the second type long-running query is identified as a starving long-running query responsive to determining that no long-running query of the first type long-running query is currently executing in the database system.

6. The method of claim 1 , wherein distinguishing between the different types of long-running queries further comprises:

identifying a third long-running query of the long-running queries as a third type long-running query different from the first type long-running query and the second type long-running query, responsive to determining that an actual execution time of the third long-running query is greater than an estimated execution time calculated by the query optimizer for the third long-running query and is less than an elapsed time of the third long-running query, but is greater than a specified time that is below the elapsed time of the third long-running query.

7. The method of claim 6 , wherein the third type long-running query is a query that consumes a large but a fair share amount of system resources and is making progress at greater than a target level.

8. The method of claim 7 , wherein the second type long-running query consumes less than a target level of the system resources.

9. The method of claim 1 , wherein determining that the actual execution time of the first long-running query is less than the elapsed time of the first long-running query but greater than a specified time that is below the elapsed time of the first long-running query is a determination that the actual execution time of the first long-running query is not much less than the elapsed time of the first long-running query, and

wherein determining that the actual execution time of the second long-running query is less than the elapsed time of the second long-running query and less than a specified time that is below the elapsed time of the second long-running query is a determination that the actual execution time of the second long-running query is much less than the elapsed time of the second long-running query.

10. A non-transitory computer readable storage medium having instructions for causing a computer to:

distinguish between different types of long-running queries simultaneously executing in a database system using a taxonomy of query performance problems, the taxonomy defining whether behavior of the long-running queries is expected, the taxonomy comprising a threshold, an estimated execution time calculated by a query optimizer for a query, an actual execution time of a query, and an elapsed time, wherein distinguishing between the different types of long-running queries using the taxonomy comprises:

identifying a respective query as a long-running query in response to an elapsed time for the respective query exceeding the threshold,

identifying a first long-running query of the long-running queries as a first type long-running query responsive to determining that an actual execution time of the first long-running query is less than an estimated execution time calculated by the query optimizer for the first long-running query and is not much less than an elapsed time of the first long-running query, and

identifying a second long-running query of the long-running queries as a second, different type long-running query responsive to determining that an actual execution time of the second long-running query is greater than an estimated execution time calculated by the query optimizer for the second long-running query and is much less than an elapsed time of the second long-running query; and

take a remedial measure for at least one of the different types of long-running queries.

11. The non-transitory computer readable storage medium of claim 10 , wherein the first type long-running query is a query that consumes a large but expected amount of system resources, and wherein the second type long-running query is a query that consumes less than a fair share of the system resources and is making poor progress because of system resource contention with other queries.

12. The non-transitory computer readable storage medium of claim 10 , wherein the second type long-running query is a query that consumes fewer system resources than expected because of a problem with the database system.

13. The non-transitory computer readable storage medium of claim 10 , wherein the taxonomy is developed for different parameters.

14. The non-transitory computer readable storage medium of claim 10 , wherein the second type long-running query is identified as a buggy long-running query responsive to determining that at least one other long-running query of the first type long-running query is currently executing in the database system, and

wherein the second type long-running query is identified as a starving long-running query responsive to determining that no long-running query of the first type long-running query is currently executing in the database system.

15. The non-transitory computer readable storage medium of claim 10 , wherein distinguishing between the different types of long-running queries further comprises:

identifying a third long-running query of the long-running queries as a third type long-running query different from the first type long-running query and the second type long-running query, responsive to determining that an actual execution time of the third long-running query is greater than an estimated execution time calculated by the query optimizer for the third long-running query and is not much less than an elapsed time of the third long-running query.

16. A database system, comprising:

a processor; and

a storage medium storing instructions executable on the processor to:

identify queries that execute in the database system as long-running queries responsive to respective elapsed times of the queries exceeding a threshold;

distinguish between different types of the long-running queries executing in the database system using a taxonomy of query performance problems, the taxonomy comprising the threshold, an estimated execution time calculated by a query optimizer for a query, and an actual execution time of a query, wherein distinguishing between the different types of the long-running queries using the taxonomy comprises:

identifying a first long-running query of the long-running queries as a first type long-running query responsive to determining that an actual execution time of the first long-running query is less than an estimated execution time calculated by the query optimizer for the first long-running query and is less than an elapsed time of the first long-running query but greater than a specified time that is below the elapsed time of the first long-running query, and

identifying a second long-running query of the long-running queries as a second type long-running query different from the first type long-running query, responsive to determining that an actual execution time of the second long-running query is greater than an estimated execution time calculated by the query optimizer for the second long-running query and is less than an elapsed time of the third long-running query, but is greater than a specified time that is below the elapsed time of the second long-running query; and

take a remedial action for a given long-running query of the long-running queries, the remedial action selected from among canceling the given long-running query, aborting the given long-running query, suspending the given long-running query, or letting the given long-running query complete.

17. The database system of claim 16 , wherein distinguishing between the different types of the long-running queries further comprises:

identifying a third long-running query of the long-running queries as a third type long-running query different from the first type long-running query and the second type long-running query, responsive to determining that an actual execution time of the third long-running query is greater than an estimated execution time calculated by the query optimizer for the third long-running query and is below a specified time that is below an elapsed time of the third long-running query.

18. The database system of claim 17 , wherein the third type long-running query is identified as a buggy long-running query responsive to determining that at least one other long-running query of the first type long-running query is currently executing in the database system, and

wherein the third type long-running query is identified as a starving long-running query responsive to determining that no long-running query of the first type long-running query is currently executing in the database system.

19. The database system of claim 16 , wherein the second type long-running query is a query that consumes a large but a fair share amount of system resources and is making progress at greater than a target level.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 9, 2015
From: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
To: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
Reel/Frame 037079/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 29, 2009
From: KROMPASS, STEFAN; KUNO, HARUMI ANNE; DAYAL, UMESHWAR; WIENER, JANET L; SAMBASIVAN, RAJA
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 023019/0347 →
Continuity (3)
Provisional Application 61078382 · Jul 5, 2008
Related Publication 20100082603A1 · Apr 1, 2010
Related Publication 20170316054A9 · Nov 2, 2017