Automatic error mitigation in database statements using backup plans

By automatically identifying and using standby plans in the database statement compiler, the poor user experience caused by compilation errors is solved, and transparent error handling is achieved.

CN119790388APending Publication Date: 2025-04-08ORACLE INT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380062899.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-09-02
Filing Date
2023-06-12
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

When errors are encountered during database statement compilation, the prior art requires manual intervention by users, resulting in poor user experience and error-prone.

Method used

Resolve errors transparently without user intervention by automatically searching in the database statement compiler and using alternate plans to handle compilation errors.

Benefits of technology

It realizes automatic error handling during database compilation, improves user experience, and avoids problems caused by manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119790388A_ABST
    Figure CN119790388A_ABST
Patent Text Reader

Abstract

Techniques for automatic error mitigation in a database system using a backup plan are provided. After receiving a database statement, an error is detected as a result of compiling the database statement. In response to detecting the error, one or more backup plans are identified that are used to process the database statement or another database statement similar to the database statement. A particular backup plan of the one or more backup plans is selected. A result of the database statement is generated based on processing the particular backup plan.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates generally to compilation of database statements, and more particularly to automatically responding to errors encountered during the database statement compilation process. Background Art

[0002] The compilation of a database statement is the process of parsing and analyzing a database statement to generate an execution plan for the database statement. The execution plan can then be executed to generate a result, such as returning rows of a certain column of a database table, where these rows meet certain criteria.

[0003] During the compilation of a database statement, the statement compiler (also called the "query optimizer") encounters various types of errors. For example, if the query optimizer attempts to access memory that is beyond the range of the process address space, one type of error may be raised. Another type of error may be raised if there is an assertion failure in the code.

[0004] One way to handle such compilation errors is to present the error to a user, such as a database administrator. The user can then review the error and perform some manual action, such as resubmitting the database statement. This approach negatively impacts the user experience and requires manual intervention, which itself can be error-prone.

[0005] The approaches described in this section are approaches that could be pursued, but are not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] In the figure:

[0007] Figure 1 is a block diagram depicting an example database system including a database server and a database in an embodiment;

[0008] Figure 2 is a flowchart depicting an example process for transparently handling database statement compilation errors in an embodiment;

[0009] Figure 3 is a block diagram illustrating a computer system upon which embodiments of the present invention may be implemented; and

[0010] Figure 4 A block diagram of a basic software system that can be used to control the operation of a computer system. DETAILED DESCRIPTION

[0011] In the following description, for the purpose of explanation, many specific details will be set forth in order to provide a comprehensive understanding of the present invention. However, it is apparent that the present invention can be practiced without these specific details. In other cases, well-known structures and devices are shown in block diagram form to avoid unnecessary obfuscation of the present invention.

[0012] General Overview

[0013] A system and method for automatic error mitigation in database statement compilation is provided. In one technique, if a statement compiler (or query optimizer) detects or otherwise encounters an error during compilation of a database statement, the statement compiler searches one or more repositories to identify suitable alternate plans that can be used to process the database statement. Alternate plans are identified and used in the same database session in which the compilation error was detected. The user may or may not be informed of the identification and subsequent handling of the alternate plan. In this way, error handling is transparent so that the database user's experience is not negatively impacted.

[0014] Sample database system

[0015] Figure 1 1 is a block diagram depicting an example database system 100 including a database server 110 and a database 120 in an embodiment. Database system 100 may include multiple database servers (not depicted) and multiple databases (not depicted). Database system 100 may be a shared-nothing database system, a shared-all database system, or a combination of both.

[0016] The database server 110 is executed on one or more computing devices. The database server 110 includes a statement receiver 112 that receives database statements (e.g., SQL statements) from one or more database clients (not depicted), a statement compiler 114 (also referred to as a "query optimizer") that compiles the database statements received by the statement receiver 112, an alternate plan selector 116 that identifies and selects an alternate plan in response to detection of a compilation error, and an execution engine 118 that executes the execution plan generated by the statement compiler 114. The "alternative plan" is a historical plan that the statement compiler 114 has generated in the past and used to successfully process database statements.

[0017] A compilation error is any error that occurs during compilation of a statement that prevents the compilation from successfully completing, which would result in a valid (executable) execution plan. If no errors are encountered during compilation of a database statement, then the alternate plan selector 116 is not called or executed with respect to the database statement. If errors are encountered during compilation of a database statement, then the alternate plan selector 116 identifies an alternate plan, which the statement compiler 114 can then process to generate an execution plan for the database statement.

[0018] Each of the statement receiver 112, the statement compiler 114, the alternate plan selector 116, and the execution engine 118 is implemented in software, hardware, or a combination of software and hardware. The database server 110 responds to requests from one or more database clients executing on one or more computing devices (not depicted). Client requests include requests to read target data 122 stored in the database 120 and requests to update the target data 122 stored in the database 120, such as delete, add, and update (i.e., replace an existing value with a new value), which can be considered as a delete followed by an insert.

[0019] A database user session comprises a connection between a database client and database server 110 and involves the database client (1) sending one or more database statements or requests to database server 110 via the connection and (2) receiving results (based on the statements / requests) from database server 110 via the connection.

[0020] The database 120 is stored on a persistent storage device and includes target data 122 and statement plans 124. Although depicted as if stored on the same storage device, the target data 122 may be stored on a storage device different from the storage device on which the statement plans 124 are stored. Examples of the target data 122 include one or more relational tables, one or more files, one or more arrays of values, one or more linked lists, or any combination thereof.

[0021] Although the target data 122 is described as being stored in the database 120, different portions of the target data 122 may also be stored simultaneously in the database server 110 (e.g., in its volatile memory). For example, the statement receiver 112 receives a database statement that requests (or queries) data that satisfies a filter criterion from a specific column of a table stored in the database 120. The execution engine 118 executes the execution plan generated by the statement compiler 114 based on the database statement. As part of the execution, the execution engine 118 retrieves data from the specific column in the database 120 and stores the data (at least temporarily) in a data storage device local to the database server 110. The execution engine 118 may then apply the filter criterion to the retrieved data to generate a result of the database statement, and then ultimately return the result to the database client that submitted the database statement.

[0022] Types of plans

[0023] The statement plan 124 may include multiple types of alternative plans, examples of which include execution plans and outlines. The metadata associated with each statement plan may include a type identifier that identifies the type of plan. The execution engine can process the execution plan to generate the results of the corresponding database statement, but cannot process the outline, which represents the intermediate stage between the receipt of the database statement and the generation of the execution plan. The execution plan is relatively complex, storing information pointers and rollback items, etc. The execution plan in the memory can be represented as a directed acyclic graph structure (DAG), which is used by the execution engine to execute database statements. This DAG representation can be viewed as an executable "physical" representation. Compared to the outline, the execution plan is short-lived and therefore cannot be used to process subsequent database statements after a short period of time.

[0024] Outlines are more "logical" than execution plans because outlines contain information that helps statement compiler 114 generate the desired execution plan when used during compilation. Therefore, outlines must be compiled by statement compiler 114 in order to be (indirectly) used to process database statements.

[0025] The information in the outline includes a collection of hints or instructions. Examples of hints include the order of database processing (for example, to perform a join operation before a filter operation or vice versa), to perform an index scan of an index instead of a table scan of the table, a merge hint indicating that a view query block should be merged into its parent query block, and a leader hint that specifies the full or partial order in which tables are to be joined (which is an example of a join-order hint).

[0026] Outlines are much more compact than execution plans. For example, an execution plan can be two orders of magnitude larger (in terms of bytes) than an outline. Outlines can be stored in volatile memory (e.g., RAM), in non-volatile memory (e.g., on disk), and can be ported across versions. Because execution plans are much larger in size than their outline counterparts, relatively few execution plans (at least fewer than outlines) can be stored in volatile memory.

[0027] Each execution plan can be associated with an outline. Thus, if an execution plan is removed from volatile storage (e.g., expires or is replaced in storage by another execution plan), the outline corresponding to the execution plan can remain in the volatile storage or can be moved to other storage (such as non-volatile storage or a slower volatile storage). Alternatively, the outline can be stored in a first storage (e.g., non-volatile storage) even if the corresponding execution plan is stored in a second storage (e.g., volatile storage).

[0028] In an embodiment, each plan (whether an execution plan or an outline) is associated with a database statement from which the plan was generated. Storing an association between a plan and its corresponding database statement may include storing (a) the text of the database statement or (b) a reference to the text of the database statement in the same entry or data structure in which the plan is stored.

[0029] In an embodiment, the alternate plan selected by the query optimizer in response to detecting an error during compilation of a database statement is an outline that includes multiple hints or instructions. There may be a scenario where the alternate plan is an execution plan. The reason for performing compilation of the database statement first is that, for various reasons, a possible execution plan (if an execution plan exists for the database statement) cannot be used. One possible reason for not selecting an existing execution plan is because the plan uses a different bind variable scope. Although using the execution plan may not be ideal for the current database statement, selecting and executing the execution plan in this case may be better than stopping processing and displaying an error.

[0030] Compile error type

[0031] The statement compiler 114 may encounter a variety of types of compilation errors, some of which are recoverable (i.e., by selecting and processing an alternative plan) and others that are not recoverable. Examples of recoverable errors include assertion failures (i.e., internal errors where there is an inconsistency, such as an expected structural integrity that does not exist), incorrect pointers, or memory corruption.

[0032] An example of an unrecoverable error is a missing table error, where a database statement requests data from a specific table, but the specific table no longer exists because, for example, the specific table was recently deleted. Even if there are hundreds of otherwise valid alternative plans, those plans cannot be used to process the database statement because each of those alternative plans references a specific table, which no longer exists. Other examples of unrecoverable errors include syntax errors and incorrect semantics, such as selecting an incorrect column in a table and selecting a column that is neither an aggregate nor a group-by key in a group-by query.

[0033] In an embodiment, if the statement compiler 114 detects an error in the set of unrecoverable errors, then the backup plan is not searched. For example, the statement compiler 114 does not invoke the backup plan in response to detecting the error. Instead, the statement compiler 114 notifies the database user of the error. The notification can be transmitted over a computer network to a database client communicatively coupled to the database server 110. The notification can identify the error and indicate that the error is unrecoverable, for example, it is not possible to respond to the request for the database statement.

[0034] Process Overview

[0035] Figure 2 is a flow chart depicting an example process 200 for transparently handling database statement compilation errors in an embodiment. Process 200 may be performed by a component of database server 110. Moreover, process 200 may be performed in a foreground process in a single database user session.

[0036] At block 210, a database statement is received. Block 210 may involve receiving a database statement from a database client that is remote from a database server. For example, the database client may be communicatively coupled to the database server via a computer network, such as the Internet. Block 210 may be performed by a receiving component that receives the database statement, (optionally) performs one or more operations on the database statement (e.g., determines that the format of each database statement is valid), and forwards the database statement to a statement compiler (or query optimizer). Any validity checks may instead be performed by the statement compiler.

[0037] At block 220, an error is detected when compiling a database statement. The error is caused by compiling the database statement. Block 220 is performed by a statement compiler.

[0038] At block 230, in response to detecting the error, one or more backup plans are identified for processing the database statement or similar database statements. Block 230 may involve accessing one or more repositories storing backup plans and comparing the text (or signature) of the database statement received in block 210 with the text (or signature) of the database statement associated with the stored backup plans. If the corresponding text / signatures match, then the backup plan associated with the stored matching database statement is identified.

[0039] In an embodiment, to find available alternate plans, there are two types of matching: (1) execution exact matching (EM, where exact textual matching between database statements) and (2) force matching (FM). EM uses text, while FM uses literal bindings to normalize text. Therefore, multiple different database statements can have the same FM. For example, one database statement has a filter predicate T.c1<5, while another statement has a filter predicate T.c1<0. Both can have the same signature under FM, and therefore can rely on the same outline or execution plan to process the corresponding database statements.

[0040] At box 240, an alternate plan is selected. If multiple alternate plans are identified in box 230, box 240 involves selecting an alternate plan from those plans. The selection can be random. Alternatively, the selection is based on one or more selection criteria. Example selection criteria include the most recent alternate plan, the alternate plan associated with the lowest execution time, the alternate plan associated with the lowest average execution plan, the alternate plan associated with the lowest number of data retrievals (or buffer acquisitions), the alternate plan associated with the lowest memory usage, or a combination of the above. Box 240 can be performed by an alternate plan selector, which is a component independent of the database statement compiler.

[0041] At block 250, a result of the database statement is generated based on processing of the selected alternate plan. The result may include multiple rows from one or more connected tables. Block 250 may involve processing (e.g., compiling by statement compiler 114) the selected alternate plan to generate an execution plan, which is then executed by execution engine 118. If the selected alternate plan is an outline, then the compilation of the database statement is referred to as "outline-driven" compilation.

[0042] Choose between multiple backup plans

[0043] As indicated at block 230, in response to the detection of the compilation error, a plurality of backup plans may be identified. As indicated at block 240, a backup plan may be selected from the plurality of backup plans according to one or more selection techniques.

[0044] In one selection technique, after a first alternate plan is identified, the alternate plan is immediately processed (e.g., compiled) without waiting for identification of other alternate plans. If no errors occur during compilation of this first alternate plan, then the alternate plan is used to process the database statement in question. On the other hand, if a compilation error occurs, then a second alternate plan is identified and processed. If no errors occur during compilation of this second alternate plan, then the database statement is processed using the second alternate plan. On the other hand, if a compilation error occurs, then a third alternate plan is identified and the process is repeated.

[0045] In another selection technique, a backup plan search is performed. After the search is complete (whether based on a time limit or based on a determination that all candidate backup plans have been considered), multiple backup plans are identified. The backup plans are ranked or sorted based on one or more ranking criteria. For example, the backup plans are ranked based on the last time those plans were used, so that the backup plans that were most recently used to process database statements (without failures or errors) are ranked highest. As another example, the backup plans are ranked based on resource consumption, so that the backup plans that consume the least computing resources are ranked highest. As another example, the backup plans are ranked based on execution time, so that the backup plans associated with the lowest execution time are ranked highest. In the related art, each identified backup plan is first compiled (if the backup plan is an outline), and then any backup plans that are not associated with compilation errors are ranked based on one or more ranking criteria.

[0046] In a related selection technique, the cost of processing a database statement using each candidate alternate plan is estimated. The cost may be based on multiple cost dimensions, such as estimated memory usage, estimated number of disk accesses, and / or estimated time to execute an execution plan based on the alternate plan. The cost estimate for the alternate plan may come directly from analyzing hints in the alternate plan, or may be generated by analyzing an execution plan generated based on the alternate plan.

[0047] The estimate of each cost dimension associated with the alternate plan can be mapped to a specific cost unit. The estimated mapped costs from the cost dimensions can then be summed to generate an overall estimated cost for the alternate plan (or an execution plan generated based on the alternate plan). This "universal" cost unit can be used to compare the estimated costs associated with different alternate plans.

[0048] Multiple repositories

[0049] In an embodiment, the database system 100 includes multiple repositories for storing backup plans. In this embodiment, the database server 110 automatically captures and stores in a first repository all outlines of all database statements compiled by the statement compiler 114. For each of the one or more outlines, the first repository may also include execution statistics related to one or more executions based on the outline. In the context of error mitigation in response to a compilation error, the execution statistics may include elapsed time, CPU time, and the number of buffer acquisitions. One or more of these execution statistics may be used in other contexts, such as identifying regression statements.

[0050] In this embodiment, the database system 100 also includes a second repository that stores statement plans that have been verified to have better performance than one or more other plans that are considered "stable." A stable plan is a plan that has been used to process one or more instances of a database statement, and each execution of the one or more instances has not resulted in a failure or error, and the execution time associated with those executions is below one or more acceptable limits. The second repository can store some plans in separate buckets until their corresponding performance is verified to be satisfactory. If the performance of a plan is compared with the performance of another plan for the same or similar database statement, the performance of the plan is verified. If it is determined that the verified plan has better performance than the peer plan, the verified plan is moved to an approved list, which makes the plan eligible to be used again. Plans in the approved list are called "accepted" plans. The second repository can be limited to storing execution plans. However, each accepted plan can be associated with an outline.

[0051] With respect to searching for alternate plans in response to a compilation error, if the alternate plans are stored in multiple plan repositories, then according to one technique, the alternate plan selector 116 searches each repository to identify any relevant alternate plans stored therein. The alternate plan selector 116 then applies one or more selection criteria to select from the identified multiple alternate plans.

[0052] According to different techniques, the backup plan selector 116 searches the plan repositories in a particular order, such as based on priority or based on the quality of the backup plans stored in the corresponding plan repositories. For example, if the performance of the backup plan has been verified against the performance of another plan and determined to be higher performance, then the backup plan is accepted and stored in the first repository that is first searched when performing the backup plan search. If the performance of the backup plan has been verified (or tested) against the performance of another plan and determined to be worse performance, then the backup plan is not accepted and is stored in the second repository that is searched second in the backup plan search.

[0053] Thus, if the plan selector 116 does not identify a candidate backup plan in the first repository as part of the backup plan search, then the backup plan selector 116 searches for one or more candidate backup plans in the second repository. If no backup plan is found in the second repository, then the third repository is searched, and so on, depending on the number of different repositories in which backup plans are stored. Thus, if the first repository has only a single backup plan that is relevant to the backup plan search, then that backup plan is selected and used to process the database statement even though there may be many backup plans in one or more other plan repositories.

[0054] Compilation error for backup plan

[0055] In some scenarios, an error may occur during the compilation of a backup plan for a database statement. The error may be the same or different from the error that triggers the backup plan selection. In an embodiment, in response to the compilation error encountered about the backup plan, the backup plan selector 116 selects another backup plan (if it exists). The backup plan selector 116 can use the same identification and selection process as the backup plan selector 116 used to select the original backup plan to select another backup plan. Therefore, if the backup plan selector 116 identifies multiple backup plans (and ranks or sorts them) in the first backup plan search in response to detecting a compilation error when compiling a database statement, if an error is encountered when compiling the first selected backup plan, the backup plan selector 116 selects the next highest ranked backup plan. The selection of the subsequent backup plan and the processing of the plan can be performed in the database user session identical to the original backup plan.

[0056] Hardware Overview

[0057] According to one embodiment, the technology described herein is implemented by one or more special-purpose computing devices. The special-purpose computing device can be hard-wired to perform the present technology, or can include a digital electronic device that is permanently programmed to perform the present technology, such as one or more application-specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs), or can include one or more general-purpose hardware processors that are programmed to perform the present technology according to program instructions in firmware, memory, other storage devices, or combinations. This special-purpose computing device can also combine customized hard-wired logic, ASICs or FPGAs with customized programming to implement the present technology. The special-purpose computing device can be a desktop computer system, a portable computer system, a handheld device, a networking device, or any other device that combines hard-wired and / or program logic to implement the technology.

[0058] For example, Figure 3 3 is a block diagram illustrating a computer system 300 upon which embodiments of the present invention may be implemented. Computer system 300 includes a bus 302 or other communication mechanism for communicating information and a hardware processor 304 coupled with bus 302 for processing information. Hardware processor 304 may be, for example, a general purpose microprocessor.

[0059] Computer system 300 also includes a main memory 306, such as a random access memory (RAM) or other dynamic storage device, coupled to bus 302 for storing information and instructions to be executed by processor 304. Main memory 306 may also be used to store temporary variables or other intermediate information during execution of instructions to be executed by processor 304. Such instructions, when stored in a non-transitory storage medium accessible to processor 304, cause computer system 300 to become a special-purpose machine customized to perform the operations specified in the instructions.

[0060] Computer system 300 also includes a read only memory (ROM) 308 or other static storage device coupled to bus 302 for storing static information and instructions for processor 304. A storage device 310, such as a magnetic disk, optical disk, or solid state drive, is provided and coupled to bus 302 for storing information and instructions.

[0061] The computer system 300 may be coupled via the bus 302 to a display 312, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 314, including alphanumeric and other keys, is coupled to the bus 302 for communicating information and command selections to the processor 304. Another type of user input device is a cursor control 316, such as a mouse, trackball, or cursor direction keys, for communicating direction information and command selections to the processor 304 and for controlling cursor movement on the display 312. Such input devices typically have two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), to allow the device to specify a position in a plane.

[0062] Computer system 300 may implement the techniques described herein using custom hardwired logic, one or more ASICs or FPGAs, firmware, and / or program logic that, in conjunction with the computer system, makes computer system 300 a special purpose machine or programs computer system 300 to be a special purpose machine. According to one embodiment, the techniques herein are performed by computer system 300 in response to processor 304 executing one or more sequences of one or more instructions contained in main memory 306. These instructions may be read into main memory 306 from another storage medium, such as storage device 310. Execution of the sequences of instructions contained in main memory 306 causes processor 304 to perform the process steps described herein. In alternative embodiments, hardwired circuitry may be used in place of or in combination with software instructions.

[0063] The term "storage medium" as used herein refers to any non-transitory medium that stores data and / or instructions that cause a machine to operate in a particular manner. Such storage media may include non-volatile media and / or volatile media. Non-volatile media include, for example, optical disks, magnetic disks, or solid-state drives, such as storage device 310. Volatile media include dynamic memory, such as main memory 306. Common forms of storage media include, for example, floppy disks, flexible disks, hard disks, solid-state drives, magnetic tapes or any other magnetic data storage media, CD-ROMs, any other optical data storage media, any physical media with a hole pattern, RAM, PROM and EPROM, FLASH-EPROM, NVRAM, any other memory chip, or cassette tapes.

[0064] Storage media are distinct from but may be used in conjunction with transmission media. Transmission media participate in the transfer of information between storage media. For example, transmission media include coaxial cables, copper wire, and optical fiber, including the wires comprising bus 302. Transmission media may also take the form of acoustic or light waves, such as those generated during radio wave and infrared data communications.

[0065] Various forms of media may be involved in carrying one or more sequences of one or more instructions to processor 304 for execution. For example, the instructions may initially be carried on a disk or solid-state drive of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 300 can receive the data on the telephone line and use an infrared transmitter to convert the data to an infrared signal. An infrared detector can receive the data carried in the infrared signal and appropriate circuitry can place the data on bus 302. Bus 302 carries the data to main memory 306, from which processor 304 retrieves and executes the instructions. The instructions received by main memory 306 may optionally be stored on storage device 310 before or after execution by processor 304.

[0066] Computer system 300 also includes a communication interface 318 coupled to bus 302. Communication interface 318 provides bidirectional data communication coupled to network link 320, wherein network link 320 is connected to local network 322. For example, communication interface 318 can be an integrated services digital network (ISDN) card, a cable modem, a satellite modem, or a modem that provides data communication connection to a telephone line of a corresponding type. As another example, communication interface 318 can be a LAN card that provides data communication connection to a compatible local area network (LAN). Wireless links can also be implemented. In any such implementation, communication interface 318 sends and receives electrical signals, electromagnetic signals, or optical signals that carry digital data streams representing various types of information.

[0067] The network link 320 typically provides data communication to other data devices through one or more networks. For example, the network link 320 can provide a connection to a host computer 324 or to data equipment operated by an Internet Service Provider (ISP) 326 through a local network 322. The ISP 326, in turn, provides data communication services through the global packet data communication network now commonly referred to as the "Internet" 328. Both the local network 322 and the Internet 328 use electrical, electromagnetic, or optical signals that carry digital data streams. The signals through the various networks and the signals on the network link 320 and through the communication interface 318 are example forms of transmission media that carry the digital data to or from the computer system 300.

[0068] Computer system 300 can send messages and receive data, including program code, through the network(s), network link 320, and communication interface 318. In the Internet example, server 330 can transmit the requested code for an application program through Internet 328, ISP 326, local network 322, and communication interface 318.

[0069] The received code may be executed by processor 304 as it is received, and / or stored in storage device 310 or other non-volatile storage for later execution.

[0070] Software Overview

[0071] Figure 4 4 is a block diagram of a basic software system 400 that may be used to control the operation of computer system 300. Software system 400 and its components, including their connections, relationships, and functions, are intended to be exemplary only and are not meant to limit implementation of the example embodiment(s). Other software systems suitable for implementing the example embodiment(s) may have different components, including components with different connections, relationships, and functions.

[0072] Software system 400 is provided for directing the operation of computer system 300. Software system 400, which may be stored on system memory (RAM) 306 and fixed storage (eg, hard disk or flash memory) 310, includes a kernel or operating system (OS) 410.

[0073] OS 410 manages low-level aspects of computer operation, including managing the execution of processes, memory allocation, file input and output (I / O), and device I / O. One or more application programs, represented as 402A, 402B, 402C ... 402N, may be "loaded" (e.g., transferred from fixed storage 310 into memory 306) for execution by system 400. Applications or other software intended for use on computer system 300 may also be stored as a downloadable set of computer-executable instructions, for example, for download and installation from an Internet location (e.g., a Web server, app store, or other online service).

[0074] The software system 400 includes a graphical user interface (GUI) 415 for receiving user commands and data in a graphical (e.g., "click" or "touch gesture") manner. In turn, these inputs can be operated by the system 400 according to instructions from the operating system 410 and / or (one or more) applications 402. The GUI 415 is also used to display the results of the operations from the OS 410 and (one or more) applications 402, and the user can provide additional input or terminate the session (e.g., log out).

[0075] The OS 410 may execute directly on the bare hardware 420 (e.g., the processor(s) 304) of the computer system 300. Alternatively, a hypervisor or virtual machine monitor (VMM) 430 may be inserted between the bare hardware 420 and the OS 410. In this configuration, the VMM 430 acts as a software "buffer" or virtualization layer between the OS 410 and the bare hardware 420 of the computer system 300.

[0076] VMM 430 instantiates and runs one or more virtual machine instances ("guest machines"). Each guest machine includes a "guest" operating system (such as OS 410), and one or more applications designed to execute on the guest operating system, such as (one or more) application 402. VMM 430 presents a virtual operating platform to the guest operating system and manages the execution of the guest operating system.

[0077] In some instances, VMM 430 can allow a guest operating system to run as if it were running directly on bare hardware 420 of computer system 300. In these instances, the same version of the guest operating system that is configured to execute directly on bare hardware 420 can also execute on VMM 430 without modification or reconfiguration. In other words, VMM 430 can, in some instances, provide full hardware and CPU virtualization to the guest operating system.

[0078] In other instances, the guest operating system may be specially designed or configured to execute on VMM 430 to improve efficiency. In these instances, the guest operating system is "aware" that it is executing on a virtual machine monitor. In other words, VMM 430 may provide paravirtualization to the guest operating system in some instances.

[0079] A computer system process includes an allocation of hardware processor time, and an allocation of (physical and / or virtual) memory, an allocation of memory for storing instructions executed by the hardware processor, for storing data generated by the execution of instructions by the hardware processor, and / or for storing hardware processor state (e.g., contents of registers) between allocations of hardware processor time when the computer system process is not running. A computer system process runs under the control of an operating system, and may run under the control of other programs executing on the computer system.

[0080] The above basic computer hardware and software are presented to illustrate the basic underlying computer components that can be used to implement the example embodiment(s). However, the example embodiment(s) are not necessarily limited to any particular computing environment or computing device configuration. Instead, the example embodiment(s) can be implemented in any type of system architecture or processing environment that a person skilled in the art would understand in light of the present disclosure as being capable of supporting the features and functions of the example embodiment(s) presented herein.

[0081] cloud computing

[0082] The term "cloud computing" is used generally herein to describe a computing model that enables on-demand access to a shared pool of computing resources, such as computer networks, servers, software applications, and services, and allows resources to be rapidly provisioned and released with minimal management effort or service provider interaction.

[0083] A cloud computing environment (sometimes referred to as a cloud environment or just a cloud) can be implemented in a variety of different ways to best suit different requirements. For example, in a public cloud environment, the underlying computing infrastructure is owned by an organization that makes its cloud services available to other organizations or the general public. In contrast, a private cloud environment is generally intended for use by or within a single organization only. A community cloud is intended to be shared by several organizations within a community; while a hybrid cloud includes two or more types of clouds (e.g., private, community, or public) bound together by data and application portability.

[0084] In general, the cloud computing model enables some of those responsibilities that might previously have been provided by an organization's own information technology department to be delivered instead as a service layer within a cloud environment for use by consumers (internal or external to the organization, depending on the public / private nature of the cloud). Depending on the specific implementation, the precise definition of the components or features provided by or within each cloud service layer may vary, but common examples include: Software as a Service (SaaS), where consumers use software applications running on a cloud infrastructure, while the SaaS provider manages or controls the underlying cloud infrastructure and applications. Platform as a Service (PaaS), where consumers can develop, deploy, and otherwise control their own applications using software programming languages ​​and development tools supported by the PaaS provider, while the PaaS provider manages or controls other aspects of the cloud environment (i.e., everything under the runtime execution environment). Infrastructure as a Service (IaaS), where consumers can deploy and run arbitrary software applications, and / or provide processing, storage, networking, and other basic computing resources, while the IaaS provider manages or controls the underlying physical cloud infrastructure (i.e., everything below the operating system layer). Database as a Service (DBaaS), in which the consumer uses a database server or database management system running on a cloud infrastructure, while the DbaaS provider manages or controls the underlying cloud infrastructure, applications, and servers, including one or more database servers.

[0085] In the foregoing description, embodiments have been described with reference to numerous specific details that vary from implementation to implementation. Accordingly, the description and drawings should be regarded as illustrative rather than restrictive. The sole and exclusive indicator of the scope of the invention, and what the applicants intend as the scope of the invention, is the literal and equivalent range of the set of claims issuing from this application, in the specific form in which such claims issue, including any subsequent corrections.

Claims

1. A method comprising: After receiving a database statement, an error is detected as a result of compiling the database statement; In response to detecting the error, identifying one or more alternate plans to be used to process the database statement or another database statement similar to the database statement; selecting a specific backup plan from the one or more backup plans; generating a result of the database statement based on processing the particular alternate plan; The method is performed by one or more computing devices.

2. The method of claim 1, wherein: The specific backup plan is an outline including a collection of prompts; Processing the specific backup plan includes generating an execution plan based on the outline; Generating the results includes executing the execution plan.

3. The method of claim 1, wherein: The one or more backup plans are multiple backup plans; Selecting the particular backup plan includes selecting the particular backup plan based on one or more selection criteria.

4. The method of claim 3, wherein the one or more selection criteria include at least one of the following: Recently created backup plans, Most recently used backup plan, the alternative plan associated with the lowest estimated cost, an alternative plan associated with a minimum execution time, or An alternative plan that is associated with using the least amount of computer resources.

5. The method of claim 3, further comprising: generating a plurality of execution plans, one execution plan for each backup plan of the plurality of backup plans; generating a cost estimate for each of the plurality of execution plans; identifying a particular execution plan having a lowest estimated cost from among the plurality of execution plans; The specific backup plan is associated with the specific execution plan.

6. The method of claim 1, further comprising: storing a first set of backup plans in a first repository; storing a second set of backup plans in a second repository different from the first repository; The one or more backup plans are stored in the first repository or the second repository.

7. The method of claim 6, wherein: The first repository is ranked higher than the second repository; Identifying the one or more backup plans includes searching a first repository and identifying the one or more backup plans in the first repository; The particular backup plan is selected without searching the second repository.

8. The method of claim 6, further comprising: searching the first repository and not identifying any candidate alternate plans for the database statement in the first repository; searching the second repository only in response to not identifying any candidate backup plans in the first repository; Wherein identifying the one or more backup plans comprises identifying the one or more backup plans in a second repository.

9. The method of claim 6, wherein: A first repository stores plans for all database statements compiled by a statement compiler; The second repository stores a first plurality of plans that have been verified to have better performance than a second plurality of plans to which the first plurality of plans correspond.

10. The method of claim 6, wherein: The second set of backup plans stored in the second repository includes the first subset of backup plans and the second subset of backup plans; Each backup plan in the first subset of backup plans has been verified to have better performance than one or more first plans corresponding to each backup plan; Each backup plan in the second subset of backup plans has not been verified to have better performance than one or more second plans corresponding to said each backup plan in the second subset.

11. One or more non-transitory storage media storing instructions that, when executed by one or more computing devices, cause the method of any one of claims 1-10 to be performed.