Patent ID: 12248470

DETAILED DESCRIPTION

Implementations of the disclosure provide for anticipatory pre-execution of queries. In accordance with an aspect of the disclosure, an execution cost may be computed for each of a multiplicity of different queries to a data source scheduled at a specified time on a specified date. Then, a querying processing schedule may be monitored so that, unscheduled time may be detected from the monitoring with respect to a particular date prior to the specified time on the specified date. Thereafter, in response to the detection of the unscheduled time, a most expensive one of the different queries in terms of execution cost first may be selected and then executed during the unscheduled time on the particular date prior to the specified time on the specified date. In this way, the most expensive one of the different queries may be anticipatorily pre-executed at a time that otherwise would be wasted so as to gain efficiencies in the total execution cost of all of the queries scheduled for processing at the specified time on the specified date.

In further illustration,FIG.1pictorially shows a process for anticipatory pre-execution of queries. As shown inFIG.1, a query processor170executes queries100against a data source140, for instance a database or data model of data in one or more databases. The query processor170executes one or more of the queries100at different scheduled times110according to a query processing schedule150in which different queries are scheduled for execution against the data source140at the different scheduled times110. Of import, each of the queries100is associated with meta-data defining the scheduled time110on a particular date when the corresponding one of the queries100is scheduled in a query processing schedule150for processing by the query processor170. As well, each of the queries100is associated with meta-data specifying a cost of processing120in terms of the resource cost (processor and memory resources, for instance), and optionally, a sensitivity to data freshness value130. The cost of processing120may be specified manually and directly in the meta-data, or the cost of processing120may be computed as a mathematical cost function accounting for several input parameters such as time to run, freshness sensitivity/elasticity and the likelihood of a requirement to re-run the query subsequently owing to an observed update in implicated records. Indeed, in one aspect of the disclosure, the parameters can be weighted differently as established by an administrator.

The sensitivity to data freshness value130indicates a reliance of a corresponding one of the queries100to underlying data that must be as current as possible to provide an accurate query result. For instance, reliance upon addressing data may be less sensitive than reliance upon daily sales information. In the former instance, may bear no impact if the corresponding one of the queries100pre-executes before the scheduled time110as addressing information is unlikely to change in the interim period of time between the time and date of pre-execution and the scheduled time110. But, in the latter instance, pre-executing a corresponding one of the queries100may produce inaccurate results if the corresponding one of the queries100depends upon data which may change in the period of time between a corresponding scheduled time110and a time of execution before the scheduled time110, such as sales data.

A monitor160monitors the query processing schedule150to identify for different time periods, whether or not any time is not scheduled for query processing or under-scheduled for query processing. Upon detecting available time180, the monitor160inspects the queries100pending processing at times future from the available time180in order to identify ones of the queries100with a highest corresponding cost of processing120. Thereafter, the monitor160selects an identified one of the queries100with a corresponding highest cost of processing120and re-schedules the selected one of the queries100for processing against the data source140by the query processor170at the detected available time180. To the extent that multiple different ones of the queries100have similar corresponding costs120determined to be highest amongst all of the queries100, one of the queries with the similar corresponding costs120is selected for pre-execution based upon a smallest corresponding data freshness sensitivity130.

The process described in connection withFIG.1may be implemented in a data processing system. In further illustration,FIG.2schematically shows a data processing system configured for anticipatory pre-execution of queries. The system includes a host computing system210that includes one or more computers, each with memory and at least one processor. The host computing system210is communicatively coupled across data communications network220to a database230and supports the operation of a query processor240adapted to execute different queries260against the database230according to a query schedule250specifying dates and times when the query processor240is to execute corresponding ones of the queries260against the database230.

Importantly, an anticipatory pre-scheduler module300executes in the memory of the host computing system210. The anticipatory pre-scheduler module300includes computer program instructions that during execution, permits the manual or automatic re-scheduling of one of the queries260to an earlier time slot known to be available based upon a monitoring of the query schedule250. As to the automatic re-scheduling, the program instructions monitor the query schedule250to identify time periods during which unscheduled time exists without a query scheduled for processing by the query processor240. To that end, the program instructions detect repeated instances of the unscheduled time over several dates when no queries are scheduled, so as to detect the unscheduled time on the particular date prior to the specified time on the specified date.

Upon detecting the unscheduled time, the program instructions are further enabled to select one of the queries260scheduled for execution at scheduled times subsequent to the unscheduled time that have a corresponding cost of execution recorded to be highest amongst all of the queries260, or in the alternative, above a threshold value. The program code, optionally, selects from multiple ones of the queries260with corresponding costs above a threshold value, one of the queries260having a lowest recorded sensitivity to changes in underlying data upon which the query is dependent. Thereafter, the program instructions pre-schedule the selected one of the queries260for pre-execution at the available time.

In even further illustration of the operation of the anticipatory pre-scheduler module300,FIG.3is a flow chart illustrating a method301for anticipatory pre-execution of queries. Beginning in block310, the module connects to the query processing schedule and in block320, the module reads a schedule of queries scheduled for processing during a next time period. In decision block330, the module determines if available time exists during the time period. If not, in block340the module selects a next time period and in block320, the module reads a schedule for a next time period. Then, the process returns to decision block330.

In decision block330, if available time exists during the time period, in block350the module selects an available time slot in the time period and in block360the module retrieves queries scheduled for a future time period beyond the selected time period. In block370, the retrieved queries are filtered to include only queries not reliant upon underlying data anticipated to be updated after the available time and before the specified time. In block380, the filtered queries are sorted by cost of execution. Then, in block390, beginning with the highest cost query, the module selects for pre-execution the query in the sort of least sensitivity to freshness of underlying data implicated by the query. Finally, in block400, the module re-schedules the selected query for pre-execution at the available time.

The present disclosure may be embodied within a system, a method, a computer program product or any combination thereof. The computer program product may include a computer readable storage medium or media having computer readable program instructions thereon for causing a processor to carry out aspects of the present disclosure. The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.

Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to implementations of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.

These computer readable program instructions may be provided to a processor of a general-purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein includes an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.

The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.

The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various implementations of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which includes one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.

Finally, the terminology used herein is for the purpose of describing particular implementations only and is not intended to be limiting of the disclosure. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “includes” and/or “including,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present disclosure has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the disclosure in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the disclosure. The implementation was chosen and described in order to best explain the principles of the disclosure and the practical application, and to enable others of ordinary skill in the art to understand the disclosure for various implementations with various modifications as are suited to the particular use contemplated.

Having thus described the disclosure of the present application in detail and by reference to implementations thereof, it will be apparent that modifications and variations are possible without departing from the scope of the disclosure defined in the appended claims as follows: