Incremental refresh of materialized views for many-to-many relationships6708179Abstract A framework for the incrementally refreshing a materialized view is provided. The materialized view is based on a query that references a projected table and another set of base tables. The query projects the columns of the projected table. To refresh the materialized view, a set of tuples is computed that identify rows to delete, insert, or otherwise modify in the materialized view in order to refresh it. The set of tuples is computed by computing a set of intersections, (1) one for the intersection between the query and the change log of the projected table, and (2) at least one other between the equijoin of the change log for one of the other base tables and the projected table. The query may define an equijoin between the projected table and at least one base table based on equijoin conditions that define a many-to-many relationship or a one-to-many relationship. Claims What is claimed is: Description FIELD OF THE INVENTION
create materialized view superstore refresh fast as
select * from bookstore where exists
(select 1 from supplies where supplies.storenum =
bookstore.storenum and exists
(select 1 from school where school.population > 1000 and
school.schoolnum = supplies.schoolnum))
union
select * from bookstore where exists
(select 1 from sale where sale.storenum = bookstore.storenum and
sale.amount > 10000)
QCM specifies a union between two queries, referenced here as QCM1 and QCM2, both of which return rows from bookstore to include in superstore. Query QCM1 specifies a join operation between table bookstore, supplies, and school based on the following join conditions: school.schoolnum=supplies.schoolnum and supplies.storenum=bookstore.storenum. These join conditions are the same as relational conditions upon which the many-to-many relationship discussed above is based. Conventional incremental refresh mechanisms are capable of incrementally refreshing materialized views whose materialized view query is based on a many-to-one relationship, where a projected table is joined to a base table along a many-to-one relationship. Conventional incremental refresh mechanisms cannot, however, incrementally refresh materialized views whose materialized view query specifies a join between a projected table and another table along a one-to-many or a many-to-many relationship. One reason for this lack of support by conventional incremental refresh mechanisms is that whether a row from a projected base table is included in a materialized view may depend on multiple rows from another base table. Thus, when a change to row in the other base table affects a row from the projected table in the materialized view, it cannot be assumed that no other rows in the base table affect the row's inclusion in the materialized view. Conventional incremental refresh approaches may also not support materialized queries that include rows from the unions of subqueries. A reason for this lack of support is that whether a row from a projected table is included in a materialized view may depend on multiple subqueries in the union of subqueries. Based on the foregoing, it is clearly desirable to provide a system that incrementally refreshes a materialized view based on materialized view queries that include rows from the unions of subqueries or that specify a join between a projected table and another table along a one-to-many or a many-to-many relationship. SUMMARY OF THE INVENTION A framework for the incrementally refreshing a materialized view is provided. According to an aspect of the present invention, the materialized view is based on a query that references a projected table and another set of base tables. The query projects the columns of the projected table. To refresh the materialized view, a set of tuples is computed that identify rows to delete, insert, or otherwise modify in the materialized view in order to refresh it. The set of tuples is computed by computing a set of intersections, (1) one for the intersection between the query and the change log of the projected table, and (2) at least one other between the equijoin of the change log for one of the other base tables and the projected table. The query may define an equijoin between the projected table and at least one base table based on equijoin conditions that define a many-to-many relationship or a one-to-many relationship. BRIEF DESCRIPTION OF THE DRAWINGS The present invention is illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which: FIG. 1 is a block diagram depicting tables used to illustrate an embodiment of the present invention; FIG. 2 is a block diagram depicting tables used to illustrate algebraic definitions according to an embodiment of the present invention; FIG. 3 is a flow chart depicting a process for refreshing a materialized view according to an embodiment of the present invention; and FIG. 4 is a block diagram of a computer system upon which an embodiment of the present invention may be implemented. DETAILED DESCRIPTION OF THE INVENTION A method and apparatus for incrementally refreshing materialized views is described. In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be apparent, however, that the present invention may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the present invention. OVERVIEW A materialized view is usually created by a DBMS in response to receiving a data definition language ("DDL") database command defining the materialized view. Typically, the DDL command specifies the materialized view query. The query is parsed and analyzed to determine whether the materialized view definition is valid. If valid, the DBMS creates the materialized view. The creation process involves generating the metadata that defines the materialized view. Another part of the creation process is the generation of refresh code. Refresh code is executed to refresh a materialized view. Refresh code may consist of database commands that specify operations for loading data from the base tables and for modifying the materialized view. Typically, these database commands contain queries and subqueries that return results that identify rows to insert, delete, or update in a materialized view. Once the refresh code is generated, it is stored in the database metadata where it is accessed by the database process that refreshes the materialized views. There are two types of refresh code: (1) full refresh code, which specifies operations for a full refresh, and (2) incremental refresh code, which specifies operations for an incremental refresh. Generally, full refresh code is generated for all materialized views, even those that are incrementally refreshed, to subsequently refresh the materialized view when it is not or can not be incrementally refreshed. Incremental refresh code typically consists of delete, insert, update, and upsert commands that operate on upon the results of subqueries that return rows identifying rows to delete, insert, or update. Incremental refresh code is generated for a materialized view when (1) the DDL command issued to define the materialized view requests so, and (2) the materialized view satisfies incremental refresh criteria. Not all types of materialized views can be incrementally refreshed; the refresh criteria separates those that can be from those that cannot. Described herein are incremental refresh techniques that allow the incremental refreshing of new classes of materialized views which could not be incrementally refreshed using conventional refresh mechanisms. Accordingly, the incremental refresh techniques affect the application of incremental refresh criteria and the generation of refresh code. A framework for the incremental refresh techniques is described using two general purpose relational algebraic tautologies. Each tautology defines, at a general level, a formula that captures the changes in the base tables since the materialized view was last refreshed. These formuli are collectively referred to herein as the solution. One tautology describes the inserts that may be used to incrementally refresh a materialized view; the other formula describes the deletes that may be used to incrementally refresh a materialized view. Those skilled in the art will recognize that these formuli can be directly mapped to database commands implemented in refresh code which can be efficiently executed, that is, without full table scans on the base tables and only a single scan of a change log for each occurrence of a base table. Change logs are sets of records (e.g. a table) that records changes to base tables. The change logs should have sufficient information to determine changes made to a base table since the last refresh. The chronological order of those changes are not needed by the incremental refresh techniques. In an embodiment of the present invention, change logs may have the same shape as the base table, i.e. column definitions. Two change logs may be used to record changes to a base table, one to record inserts, the other to record deletes. For updates to a row in a base table, a record recording the old values may be inserted into the log for recording deletes, a record recording the new values may be inserted into the log for recording inserts. Other embodiments may use a different form of change logs. For example, only one change log may be used for a base table to record changes to the base table. The change log contains records that indicate whether the records are recording an insert, delete, or update. For updates, only the changed values are recorded. The incremental refresh techniques allow generation of refresh code that include queries that may operate under various constraints. Typically, the queries may only rely upon the latest values of the base tables and their change logs to refresh the materialized view. The materialized view values themselves are not used. In addition, the change logs may contain more but not less than the changes since the previous refresh. Before delving into relational algebra, a description of the following notations and definitions are introduced. ALGEBRAIC NOTATION AND DEFINITIONS Tuple A tuple is an ordered sequence of named attribute values. A row in a table is an example of a tuple. The columns of the row correspond to attributes. Relation A relation is a set of tuples with the same attributes. A table is an example of a relation. The rows returned by a query is another example of a relation. FIG. 2 shows relations R 220 and R 250, which are used to illustrate definitions that follow. Relation RV 220 has attributes 221 and 222 and includes four tuples 220-1 through 220-4 ; Relation R 250 has attributes 251 and 252 and includes four tuples 250-1 through 250-4. Set Operators R.sub.1.andgate.R.sub.2 is the intersection of the relations R.sub.1 and R.sub.2. An intersection is the set of tuples that exist in both R.sub.1 and R.sub.2. R 260 is the intersection of R 220 and R 250. R 260 contains tuples that correspond to 220-1, 220-3, 250-1, and 250-3. R.sub.1.orgate.R.sub.2 is a union of the relations R.sub.1 and R.sub.2 with duplicates eliminated. Such a union is referred to herein as a distinct union. R 270 is a distinct union between R 220 and R 250. It contains all tuples that are either in R 220 or R 250. R.sub.1 -R.sub.2 is the difference of the relations R.sub.1 and R.sub.2. The difference between R.sub.1 and R.sub.2 are the tuples in R.sub.1 that not in the intersection between R.sub.1 and R.sub.2. R 280 is the difference between R 220 and R 250. It includes tuples that are in R 220 that are not in R 260. Equijoin Operator (R.sub.1.sym.R.sub.2.sym. . . . .sym.R.sub.n) is an equijoin of relations R.sub.1,R.sub.2, . . . ,R.sub.n with equijoin conditions specified in J. All the conditions in J are and'ed together. An equijoin between one or more relations is a set of tuples, where each tuple in the set is a combination of one tuple from one relation with a tuple from another relation, where the pair of tuples satisfy a join condition. The join condition is that a column value in one of the tuples is equal to a column value in the other tuple. The equijoin defined by QCM1 is as follows. (bookstore.sym.supplies).sub.{supplies.storenum=bookstore.storenum} (R.sub.1.sym.R.sub.2.sym. . . . .sym.R.sub.n).sub.K for 1<i<n is an equijoin of fewer relations using K. K is the subset of the join conditions in J which apply to relations R.sub.1,R.sub.2, . . . ,R.sub.i. .sigma.--Selection Operator .sigma..sub.s (R) is a subset of the relation R which satisfy the conditions in S. .PI. Projection Operator .PI..sub.C (R) is a relation with only the subset C of columns in R with duplicates eliminated. To illustrate the notation described above, the following expression EX is provided. EX represents the subquery QCM, which defines subqueries QCM1 and QCM2. These were defined in the subsection ILLUSTRATIVE MATERIALIZED VIEW DEFINITION of the BACKGROUND section ##EQU1## INCREMENTAL REFRESH CRITERIA The incremental refresh techniques can be used to incrementally refresh a materialized view query Q.sub.mv that has the general form specified by formula F. Q.sub.mv =.PI..sub.C.sub..sub.0 (R.sub.11.sym.R.sub.12.sym. . . . .sym.R.sub.1l.sub..sub.i ).sub.J.sub..sub.1 .orgate. . . . .orgate..PI..sub.C.sub..sub.0 (R.sub.n1.sym.R.sub.n2.sym.R.sub.n3.sym.R.sub.nl.sub..sub.i ) where: n is the number of unioned subqueries in Q.sub.mv, l.sub.i is the number of relations in the n.sup.th unioned subquery of Q.sub.mv, R.sub.ij is the j.sup.th relation in the i.sup.th unioned subquery, R.sub.ij is .sigma.(T.sub.ij).sub.Sij (S.sub.ij being a filter condition), and the relations T.sub.ij are base tables. Furthermore, T.sub.jl is the same table T.sub.0 for all n distinct unions; T.sub.0 is referred to as the outer table. The other base tables are referred to as inner tables. C.sub.0 must also be a subset of columns of T.sub.0. Application of the criteria may be illustrated with reference to QCM. QCM is a distinct union of subqueries, defined by QCM1 and QCM2. Therefore, n=2. The following table A specifies other values that apply to query QCM under formula F.
TABLE A
i = 1 l.sub.1 = 3 (i.e. bookstore, supplies, school)
(i.e. QCM1) R.sub.11 corresponds to bookstore
R.sub.12 corresponds to .sigma.(school).sub.{school.population
> 1000}
R.sub.13 corresponds to supplies
C.sub.0 corresponds to storenum, name, & location in bookstore
i = 2 l.sub.2 = 2
(i.e. QCM2) R.sub.21 corresponds to bookstore
R.sub.22 corresponds .sigma.(sales).sub.{sales.amount >
10000}
C.sub.0 corresponds to storenum, name, & location in bookstore
QCM1 and QCM2 are unioned subqueries that (1) define an equijoin between the base tables, (2) project the same columns from the same table, i.e. the outer table bookstore, and (3) return tuples with no duplicates. Therefore, query QCM satisfies the incremental refresh criteria. The incremental refresh criteria for the incremental refresh techniques can be summarized as follows. The materialized view query must define distinct unions between subqueries that define an equijoin between base tables, each unioned subquery projecting the same columns from the same outer table. CONSTRAINTS FOR .DELTA..sup.+ and .DELTA..sup.- The solution describes a formula for generating tuples that identify a tuple to insert. These tuples are referred to as .DELTA..sup.+. The solution also describes a formula for generating tuples that identify a tuple to delete. These tuples are referred to as .DELTA..sup.-. .DELTA..sup.+ are .DELTA..sup.- are defined as follows.
I. .DELTA..sup.+.OR left. Q - Q' .DELTA..sup.+ is a superset of tuples
that includes at least the
difference between Q and Q'. Q' is the value of
Q.sub.mv at time t. Thus, .DELTA..sup.+ contains a
superset of the
tuples added to the materialized view since time t.
II. .DELTA..sup.+.OR right. Q .DELTA..sup.+ is a subset of the tuples in Q.
Thus, every
tuple in .DELTA..sup.+ is in Q, the current value of
the
materialized view.
III. .DELTA..sup.-.OR left. Q' - Q .DELTA..sup.- is a superset of the
difference between Q' - Q.
Thus .DELTA..sup.- is a superset of the tuples deleted
from
the materialized view since time t.
IV. .DELTA..sup.- .andgate. Q = NILL There is no tuple in .DELTA..sup.-
that is in the current value
of the materialized view at time t.
The formula for calculating .DELTA..sup.+ and .DELTA..sup.- are based on information available in change logs and the current value of the base tables. Thus, the following are given:
1. R.sub.ij The current value of a relation. R'ij is the value at a
previous time t.
2. .DELTA..sup.+.sub.ij, where: .DELTA..sup.+.sub.ij is a superset of the
tuples that have been
.DELTA..sup.+.sub.ij .OR left. Rij - R'ij inserted into R.sub.ij after
time t. .DELTA..sup.+.sub.ij may be computed
from change logs. .DELTA..sup.+.sub.ij may include more
inserted
rows than were actually inserted since time t. Note
the definition of .DELTA..sup.+.sub.ij does not require
the
chronological order of the inserts.
3. .DELTA..sup.-.sub.ij, where: .DELTA..sup.-.sub.ij is a superset of the
tuples deleted from R'ij from
.DELTA..sup.-.sub.ij .OR left. R'ij - Rij time t. .DELTA..sup.-.sub.ij
may be may be computed from the
materialized view logs. .DELTA..sup.-.sub.ij may include
more
deleted rows than were actually deleted since time t.
Note the definition of .DELTA..sup.-.sub.ij does not
require the
chronological order of the deletes.
INCREMENTAL REFRESH SOLUTION The following are the formuli for the solution. ##EQU2## It should be noted that even though the formula references the values Q, the formula and its reference to Q may be mapped to queries and subqueries in the refresh code. As mentioned before, Q.sub.mv defines n unioned subqueries, each of the n subqueries defining an equijoin between l.sub.i relations. As shown above, .DELTA..sup.+ may be computed as a distinct union of a set of intersections, the set including a subset of intersections for each i.sup.th unioned subquery. For each i.sup.th unioned subquery, (1) an intersection is computed between Q and the .DELTA..sup.+.sub.i0 of the outer table, and (2) an intersection is computed for each given inner table of the i.sup.th subquery, the intersection being the intersection between Q and an equijoin between a subset of the l.sub.i relations and .DELTA..sup.+.sub.ij of the given inner table. The subset of l.sub.i relations is composed of the relation for the outer table and the relations 2 to (j-1). Thus, the computation of .DELTA..sup.+ includes a computation of a join between a .DELTA..sup.+.sub.ij for each base table and Q and/or other base tables. .DELTA..sup.- may be computed as a distinct union of a set of differences, the set including a subset of differences for each i.sup.th unioned subquery. For each i.sup.th unioned subquery, (1) a difference is computed between Q and the .DELTA..sup.-.sub.i0 of the outer table, and (2) a difference is computed for each given inner table of the i.sup.th subquery, the difference being the difference between Q and the equijoin between a subset of the l.sub.i relations and .DELTA..sup.-.sub.ij of the given inner table. The subset of l.sub.i relations is composed of the relation for the outer table and the relations 2 to (j-1). Thus, the computation of .DELTA..sup.- includes a computation of a join between .DELTA..sup.-.sub.ij for each base table and Q and/or other base tables. ILLUSTRATIVE COMPUTATIONS The computation of .DELTA..sup.+ and .DELTA..sup.- may be illustrated using the query QMVE.
select * from bookstore where exists
(select 1 from supplies where supplies.storenum =
bookstore.storenum)
QMVE may be represented by the expression ARQ as follows. .PI..sub.{storenum, .sub..sub.name, location} (bookstore.sym.supplies).sub.{supplies.storenum=bookstore.storenum} The application of the solution yields the following expression ARP for computing .DELTA..sup.+. ##EQU3## QMVE specifies one unioned subquery that defines an equijoin operation between bookstore and supplies, so n=1 and l.sub.i =2. Accordingly, ARQ represents a distinct union of two intersections: one between Q and a projection of an equijoin between bookstore and .DELTA..sup.+.sub.supplies ; the other between Q and .DELTA..sup.+.sub.bookstore. The application of the solution yields the following expression ARM for computing .DELTA..sup.-. ##EQU4## ARM is a distinct union of two intersections: one between Q and a projection of an equijoin between bookstore and .DELTA..sup.-.sub.supplies ; the other intersection being an intersection between Q and .DELTA..sup.-.sub.bookstore. The table values shown in FIG. 1 are used to further illustrate the computation .DELTA..sup.+ and .DELTA..sup.-, and how the computation may be used to identify tuples needed to refresh a materialized view. The values of tuples are described using the following notation format (c.sub.1,c.sub.2), where, for bookstore and Q or Q', c1=storenum and c.sub.2 =location, and for supplies, c.sub.1 =storenum and c.sub.2 =schoolnum. Other columns are not illustrated because they are not necessary for the illustration. The following is an example of a row where bookstore.storenum=1, bookstore.location=`CA`. (1, CA) A set of tuples is represented as follows: {(1, CA), (2, FL))} In addition, a join of a row in bookstore and supplies is represented according to the notation format (bookstore.storenum, bookstore.location, supplies.storenum, supplies.schoolnum). Thus, the result of an equijoin operation between row 122 and row 133 is represented as follows. (2, FL, 2,1) In the illustration, rows 133 and 134 are deleted. Thus, .DELTA..sup.-.sub.supplies ={(2,1),(2,3)}, and Q=(1, CA). .DELTA..sup.- is computed as follows: ##EQU5## .DELTA..sup.- identifies (2, FL) as a row to delete from Q' in order to incrementally refresh the materialized view. The join conditions supplies.storenum=bookstore.storenum have been omitted from the above expression and other following expressions for purposes of exposition. In the illustration, assume that only row 133 is deleted. Thus, .DELTA..sup.-.sub.storenum =(2,1), and Q={(1, CA), (2, FL)}. A is computed as follows: ##EQU6## A identifies no rows to delete from Q' in order to incrementally refresh the materialized view. The above illustration demonstrates how the projection of the equijoin between .DELTA..sup.-.sub.storenum and the current value of bookstore generates a list of "potential" tuples identified for deletion, i.e. (2, FL), and how computing the difference between Q and the list of "potential" tuples may eliminates tuples from this list of potential tuples. Changes to base tables may not only contain inserts and deletes, but updates. As mentioned before, updates created in the change log correspond to log records representing a delete of the old values and an insert of the new values. The following examples illustrate how .DELTA..sup.+ and .DELTA..sup.- are computed when base tables are updated. Assume row 122 is updated from (2, FL) to (2, PA). Thus, .DELTA..sup.-.sub.bookstore =(2,FL), .DELTA..sup.+ =(2, PA), and Q={(1, CA), (2, `PA`)}. .DELTA..sup.- and .DELTA..sup.+ are computed as follows: ##EQU7## The next example illustrates computation of .DELTA..sup.+ and .DELTA..sup.- when a row is inserted into the outer table that does not join with any row in an inner table, and when later a row is inserted into the inner table that does join with the row inserted into the outer table. For purposes of illustration, row (3, TX) is added to bookstore. Therefore, .DELTA..sup.+.sub.bookstore =(3, TX), and bookstore={(1, CA), (2, FL), (3, TX)}, and Q={(1, CA), (2, FL)}. .DELTA..sup.- computed as follows: ##EQU8## Even though row (3, TX) is in .DELTA..sup.+.sub.bookstore, the application of the formula for .DELTA..sup.+ precludes the row's inclusion in .DELTA..sup.+ and its insertion into the materialized view. Next, (3,2) is inserted into supplies. Therefore, .DELTA..sup.+.sub.supplies =(3,2), bookstore={(1, CA), (2, FL), (3, TX)}, and Q={(1, CA), (2, FL), (3, TX)}. .DELTA..sup.+ is computed as follows: ##EQU9## IMPLEMENTATION AND OPTIMIZATION Refresh code is generated to be later executed to delete, insert, or update tuples that are identified by .DELTA..sup.+ and .DELTA..sup.-. In general, the refresh code includes a database command that inserts rows and a database command that deletes rows. The database commands that insert rows insert rows returned by subqueries that identify the rows in .DELTA..sup.+. The subqueries specify equijoin conditions and other select conditions needed to produce .DELTA..sup.+. Some of the subqueries may also return rows representing the intersection between Q.sub.mv and the base tables or equijoins. An intersection between a query and a relation is data in a relation that satisfies the query. An intersection between a query and another query is the resultant tuples of the query that satisfy the other query. The database commands that delete rows delete rows returned by subqueries that identify the rows in .DELTA..sup.-. The subqueries specify equijoin conditions and other select conditions needed to produce .DELTA..sup.-. Some of the subqueries may also return rows representing the difference between Q.sub.mv and the base tables or equijoins. A difference between a relation and a query is data in the relation that does not satisfy the query. An intersection between a query and another query is the resultant tuples of the query that do not satisfy the other query. FIG. 3 is a flow chart depicting an overview of a process that may be followed by a DBMS to incrementally refresh a materialized view. The process may be implemented through refresh code generated for a materialized view. Referring to FIG. 3, at step 310, the DBMS deletes rows identified by the results of a subquery that generates .DELTA..sup.-. At step 320, the DBMS inserts rows identified by the results of a subquery that generates .DELTA..sup.+. To further optimize execution of the refresh code, a variety of measures may be used. First, a primary key can be included in one of the projected columns of the outer table. Some types of logs indicate whether a particular field has changed. If a change log indicates that a primary key has not changed for a row included in the materialized view, then a row in the materialized view need only be updated with the new values. The overhead of performing both an insert and a delete can be avoided in this way. Second, the join columns should be indexed. PROOF The following is a proof showing that the solution properly computes .DELTA..sup.+ and .DELTA..sup.-. The constraints for .DELTA..sup.+ and .DELTA..sup.- and the solution are reproduced below. I. .DELTA.+.OR left. Q-Q' II. .DELTA.+.OR right. Q III. .DELTA..sup.-.OR left. Q'-Q IV. .DELTA..sup.-.andgate.Q=NILL It is asserted that: ##EQU10## Clearly, constraints II and IV are trivial to prove. As for I, consider any row r in Q-Q'. Since it belongs to Q it must exist in at least one of the terms in the union of Q, say the i.sup.th term. In other words, r is constructed by the join of rows r.sub.i1 from R.sub.i1, r.sub.i2 from R.sub.i2, . . . , r.sub.il.sub..sub.i from R.sub.il.sub..sub.i . Since r is not in Q' there must be some j such that r.sub.ij is not in R.sub.ij '. In other words, r.sub.ij is in .DELTA..sup.+.sub.ij and hence r is in .DELTA..sup.+ since it is in the union-ed query resulting from these values of i and j. As for III, consider any row r' in Q'-Q, say it belongs to the i.sup.th term of Q'. In other words, r is constructed by the join of rows r.sub.il ' from R.sub.il ', r.sub.i2 ' from R.sub.i2 ', . . . , r.sub.ili ' from R.sub.ili '. Since r' is not in Q there most be some j such that r.sub.ij ' is not in R.sub.ij. Thus, r.sub.ij ' is in .DELTA..sup.-.sub.ij. If we consider the term in .DELTA..sup.-.sub.ij contributed by the smallest such j it follows that r' is in .DELTA..sup.-.sub.ij . HARDWARE OVERVIEW FIG. 4 is a block diagram that illustrates a computer system 400 upon which an embodiment of the invention may be implemented. Computer system 400 includes a bus 402 or other communication mechanism for communicating information, and a processor 404 coupled with bus 402 for processing information. Computer system 400 also includes a main memory 406, such as a random access memory (RAM) or other dynamic storage device, coupled to bus 402 for storing information and instructions to be executed by processor 404. Main memory 406 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed by processor 404. Computer system 400 further includes a read only memory (ROM) 408 or other static storage device coupled to bus 402 for storing static information and instructions for processor 404. A storage device 410, such as a magnetic disk or optical disk, is provided and coupled to bus 402 for storing information and instructions. Computer system 400 may be coupled via bus 402 to a display 412, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 414, including alphanumeric and other keys, is coupled to bus 402 for communicating information and command selections to processor 404. Another type of user input device is cursor control 416, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 404 and for controlling cursor movement on display 412. This input device typically has two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), that allows the device to specify positions in a plane. The invention is related to the use of computer system 400 for incrementing materialized views. According to one embodiment of the invention, incrementing materialized views as provided by computer system 400 in response to processor 404 executing one or more sequences of one or more instructions contained in main memory 406. Such instructions may be read into main memory 406 from another computer-readable medium, such as storage device 410. Execution of the sequences of instructions contained in main memory 406 causes processor 404 to perform the process steps described herein. One or more processors in a multi-processing arrangement may also be employed to execute the sequences of instructions contained in main memory 406. In alternative embodiments, hardwired circuitry may be used in place of or in combination with software instructions to implement the invention. Thus, embodiments of the invention are not limited to any specific combination of hardware circuitry and software. The term "computer-readable medium" as used herein refers to any medium that participates in providing instructions to processor 404 for execution. Such a medium may take many forms, including but not limited to, non-volatile media, volatile media, and transmission media. Non-volatile media includes, for example, optical or magnetic disks, such as storage device 410. Volatile media includes dynamic memory, such as main memory 406. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise bus 402. Transmission media can also take the form of acoustic or light waves, such as those generated during radio wave and infrared data communications. Common forms of computer-readable media include, for example, a floppy disk, a flexible disk, hard disk, magnetic tape, or any other magnetic medium, a CD-ROM, any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, any other memory chip or cartridge, a carrier wave as described hereinafter, or any other medium from which a computer can read. Various forms of computer readable media may be involved in carrying one or more sequences of one or more instructions to processor 404 for execution. For example, the instructions may initially be carried on a magnetic disk 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 400 can receive the data on the telephone line and use an infrared transmitter to convert the data to an infrared signal. An infrared detector coupled to bus 402 can receive the data carried in the infrared signal and place the data on bus 402. Bus 402 carries the data to main memory 406, from which processor 404 retrieves and executes the instructions. The instructions received by main memory 406 may optionally be stored on storage device 410 either before or after execution by processor 404. Computer system 400 also includes a communication interface 418 coupled to bus 402. Communication interface 418 provides a two-way data communication coupling to a network link 420 that is connected to a local network 422. For example, communication interface 418 may be an integrated services digital network (ISDN) card or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface 418 may be a local area network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be implemented. In any such implementation, communication interface 418 sends and receives electrical, electromagnetic or optical signals that carry digital data streams representing various types of information. Network link 420 typically provides data communication through one or more networks to other data devices. For example, network link 420 may provide a connection through local network 422 to a host computer 424 or to data equipment operated by an Internet Service Provider (ISP) 426. ISP 426 in turn provides data communication services through the worldwide packet data communication network now commonly referred to as the "Internet" 428. Local network 422 and Internet 428 both use electrical, electromagnetic or optical signals that carry digital data streams. The signals through the various networks and the signals on network link 420 and through communication interface 418, which carry the digital data to and from computer system 400, are exemplary forms of carrier waves transporting the information. Computer system 400 can send messages and receive data, including program code, through the network(s), network link 420 and communication interface 418. In the Internet example, a server 430 might transmit a requested code for an application program through Internet 428, ISP 426, local network 422 and communication interface 418. In accordance with the invention, one such downloaded application provides for incrementally refreshing materialized views as described herein. The received code may be executed by processor 404 as it is received, and/or stored in storage device 410, or other non-volatile storage for later execution. In this manner, computer system 400 may obtain application code in the form of a carrier wave. In the foregoing specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
|
Same subclass Same class Consider this |
||||||||||
