1. Technical Field
The present invention is directed to database systems. More specifically, the present invention is directed to a system, apparatus and method of pre-fetching data from a database system.
2. Description of Related Art
Many application programs require access to functions of a relational database to ensure efficient management and availability of data. As a result, application program source code often contains embedded query language statements to interface with a relational database. The statements may include commands to fetch data that is to be provided to a user. In some instances, it may be desirable to pre-fetch and store particular pieces of data into a cache in order to lessen the time it would ordinarily require to provide the data to the user. For example, an image file, which is data-intensive, may be pre-fetched into the cache.
However, unless a piece of data is likely to be provided to the user, it may be counter-productive to pre-fetch the data. Thus, what is needed is a system, apparatus and method of determining data that is likely to be provided to the user such that it can be pre-fetched.
The present invention provides a system, apparatus and method of pre-fetching data. When a first piece of information is being displayed to a user, the system, apparatus and method determine whether a second piece of information is data-intensive and likely to be accessed. If so, it is pre-fetched into a cache. Consequently, if the user decides to access to the second piece of information, it will be provided in a relatively short time.
To implement the invention, however, the application program used to display the information to the user is first parsed for embedded database query calls. If the application program provides the information to the user in a number of succeeding panels, each piece of code representing a panel will be individually parsed. Each query call is identified as selectable or un-selectable. A selectable query call is a call that is used to fetch a piece of data-intensive information; whereas an un-selectable query call is a call that is used to fetch non-data-intensive information. Each selectable call is entered in its respective panel in a table, which is divided into the same number of panels. This allows the system, apparatus and method to determine whether a second piece of information is data-intensive and likely to be accessed and thus to pre-fetch it into a cache.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
FIGS. 4(c), 4(d) and 4(e) depict steps that may be used by a developer to implement the invention.
With reference now to the figures,
In the depicted example, server 104 is connected to network 102 along with storage unit 106. In addition, clients 108, 110, and 112 are connected to network 102. These clients 108, 110, and 112 may be, for example, personal computers or network computers. In the depicted example, server 104 provides data, such as boot files, operating system images, and applications to clients 108, 110 and 112. Clients 108, 110 and 112 are clients to server 104. Network data processing system 100 may include additional servers, clients, and other devices not shown. In the depicted example, network data processing system 100 is the Internet with network 102 representing a worldwide collection of networks and gateways that use the TCP/IP suite of protocols to communicate with one another. At the heart of the Internet is a backbone of high-speed data communication lines between major nodes or host computers, consisting of thousands of commercial, government, educational and other computer systems that route data and messages. Of course, network data processing system 100 also may be implemented as a number of different types of networks, such as for example, an intranet, a local area network (LAN), or a wide area network (WAN).
Referring to
Peripheral component interconnect (PCI) bus bridge 214 connected to I/O bus 212 provides an interface to PCI local bus 216. A number of modems may be connected to PCI local bus 216. Typical PCI bus implementations will support four PCI expansion slots or add-in connectors. Communications links to network computers 108, 110 and 112 in
Additional PCI bus bridges 222 and 224 provide interfaces for additional PCI local buses 226 and 228, from which additional modems or network adapters may be supported. In this manner, data processing system 200 allows connections to multiple network computers. A memory-mapped graphics adapter 230 and hard disk 232 may also be connected to I/O bus 212 as depicted, either directly or indirectly.
Those of ordinary skill in the art will appreciate that the hardware depicted in
The data processing system depicted in
With reference now to
An operating system runs on processor 302 and is used to coordinate and provide control of various components within data processing system 300 in
Those of ordinary skill in the art will appreciate that the hardware in
As another example, data processing system 300 may be a stand-alone system configured to be bootable without relying on some type of network communication interface, whether or not data processing system 300 comprises some type of network communication interface. As a further example, data processing system 300 may be a Personal Digital Assistant (PDA) device, which is configured with ROM and/or flash ROM in order to provide non-volatile memory for storing operating system files and/or user-generated data.
The depicted example in
The present invention provides a system, apparatus and method of determining data to pre-fetch. The invention may be local to client systems 108, 110 and 112 of
Java Database Connectivity (JDBC) is a Java application program interface (API) that enables Java programs to execute Structured Query Language (SQL) statements. (SQL is a standardized query language for requesting information from a database.) This allows Java programs to interact with any SQL-compliant database. Since nearly all relational database management systems (DBMSs) support SQL, and because Java runs on most platforms, JDBC makes it possible to write a single database application that can run on different platforms and interact with different DBMSs.
Further, Open DataBase Connectivity (ODBC) is an API that allows a program to access functions of a database. ODBC makes it possible to access any data from any application, regardless of which DBMS is handling the data. ODBC manages this by inserting a middle layer, a driver, between an application program and the DBMS. The driver translates the application's data queries into commands that the DBMS understands. Thus, OBDC is language-independent. Hence, Java programming may interact as well with ODBC.
Consequently, either JDBC or ODBC may be used with the present invention. Further, the invention will be explained using Java and SQL. However, it should be understood that any other programming language (e.g., C, C++, COBOL, etc.) and any other query language may equally be used. Thus, the use of Java and SQL is for illustration purposes only.
In any event, the Java application may provide the user with categories or types of pets that are available from the Pet Shop (see display box 412) when the user so indicates (see user select box 414) on user interface 410 (i.e., screen of client system in use). If the user selects Mammals as shown in user select box 418, then a list of mammals that the Pet Shop carries may be displayed (see display box 416). After the user has selected cats from the list of mammals (see user select box 422), the different types of cats available from the Pet Shop will be displayed as shown in display box 420. If the user selects Persian (see user select box 424), an image of a Persian cat, as well as detailed information on Persian cats, may be displayed as shown in display box 426.
To provide the user with the information shown in each of the display boxes, embedded SQL statements in the Java application 402 may be used to fetch the data representing the information. The information displayed in display boxes 412, 416 and 420 may be provided in a relatively short time from the Pet Shop database 404. However, the information displayed in information box 426 may take a longer time since an image, which is data-intensive, is provided. Thus, to enhance user experience when browsing the Pet Shop Web site, the information in display box 426 may advantageously be pre-fetched from database 404 into a cache.
To pre-fetch the images, as well as the detailed information on all cats in the database, an SQL mediator 430 is implemented. The SQL mediator 430 is a Java plug-in software module. To create the SQL mediator 430, a programmer may traverse through the application panels (the panels that are to be displayed in display boxes 412, 416, 420 and 426) with a developer tool to identify the SQL calls to fetch data from the database. Each identified SQL call may be selected to be part of the SQL mediator 430. In this case, only the calls from the panel representing display box 416 may be selected since only these SQL calls fetch data-intensive information. Thus, when the user selects cats from display box 416, the SQL mediator may pre-fetch images of all the cats that the Pet Shop carries into the cache.
In FIGS. 4(c), 4(d) and 4(e), the steps that may be used by a developer to implement the SQL mediator 430 of the present invention are displayed. Particularly in
Thus, using the visual tools available from WSAD, the developer may parse the Java application 402 for the SQL calls from panels 410, 412, 416 and 420 (see box 452). As the developer parses the Java application, the developer may identify and select the SQL calls as shown in box 440 of
Note that the SQL mediator module 430 will also be created to pre-fetch images and information on all dogs that the Pet Shop carries if the user selects dogs from the list of mammals 416. Likewise, the SQL mediator will pre-fetch images and information on all mice or rabbits if the user selects mice or rabbits, respectively, from the list of mammals 416.
If instead of mammals, the user selects fish from the categories of pets displayed in display box 412. Then, when the list of all the fish is displayed on display box 416, the SQL mediator 430 will pre-fetch images and detailed information on all fish carried by the Pet Shop. The same is true for the birds.
The next logical panel to be displayed from the previously parsed panel is then parsed for SQL calls. Again, all SQL calls that are for data-intensive information may be selected for inclusion in the SQL mediator 430. This process may continue until all possible panels in the application program are parsed before the process ends (steps 508, 512 and 510).
The SQL calls are entered in the SQL mediator 430 in their logical panel order. For example, SQL calls from the panel representing display box 420 (e.g., images and information on all cats) will be logically entered in the SQL mediator in an area corresponding to that panel.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.